From 949917dc0fd698f1f41fa544ebb418af74dfa393 Mon Sep 17 00:00:00 2001 From: Nicolas Delaby <nicolas@nexedi.com> Date: Fri, 17 Jun 2011 15:14:41 +0200 Subject: [PATCH] deprecate fromText Methods --- product/ERP5/Document/Coordinate.py | 3 ++- product/ERP5/Document/GeographicAddress.py | 2 ++ product/ERP5/Document/InternetProtocolAddress.py | 2 ++ product/ERP5/Document/Telephone.py | 1 + product/ERP5/Document/Url.py | 2 ++ 5 files changed, 9 insertions(+), 1 deletion(-) diff --git a/product/ERP5/Document/Coordinate.py b/product/ERP5/Document/Coordinate.py index 2e022324e9..a5056e2788 100644 --- a/product/ERP5/Document/Coordinate.py +++ b/product/ERP5/Document/Coordinate.py @@ -31,6 +31,7 @@ from AccessControl import ClassSecurityInfo from Products.ERP5Type import Permissions, PropertySheet, interfaces from Products.ERP5Type.Base import Base +from Products.ERP5Type.Utils import deprecated from Products.CMFDefault.utils import formatRFC822Headers import re @@ -136,9 +137,9 @@ class Coordinate(Base): calls asText """ return self.asText() - security.declareProtected( Permissions.ModifyPortalContent, 'fromText' ) + @deprecated def fromText(self, coordinate_text): """ modifies the coordinate according to the input text diff --git a/product/ERP5/Document/GeographicAddress.py b/product/ERP5/Document/GeographicAddress.py index e931003ad4..77d4192b45 100644 --- a/product/ERP5/Document/GeographicAddress.py +++ b/product/ERP5/Document/GeographicAddress.py @@ -30,6 +30,7 @@ from AccessControl import ClassSecurityInfo from Products.ERP5Type import Permissions, PropertySheet from Products.ERP5Type.Base import Base +from Products.ERP5Type.Utils import deprecated from Products.ERP5.Document.Coordinate import Coordinate @@ -80,6 +81,7 @@ class GeographicAddress(Coordinate, Base): return result security.declareProtected(Permissions.ModifyPortalContent, 'fromText') + @deprecated def fromText(self, coordinate_text): """ Tries to recognize the coordinate_text to update diff --git a/product/ERP5/Document/InternetProtocolAddress.py b/product/ERP5/Document/InternetProtocolAddress.py index 68de3de9c9..22dd058648 100644 --- a/product/ERP5/Document/InternetProtocolAddress.py +++ b/product/ERP5/Document/InternetProtocolAddress.py @@ -31,6 +31,7 @@ from AccessControl import ClassSecurityInfo from Products.ERP5Type import Permissions, PropertySheet from Products.ERP5Type.Base import Base from Products.ERP5Type.Utils import convertToUpperCase +from Products.ERP5Type.Utils import deprecated from Products.ERP5.Document.Coordinate import Coordinate @@ -72,6 +73,7 @@ class InternetProtocolAddress(Base, Coordinate): result = '\n'.join(tmp) return result + @deprecated def fromText(self, coordinate_text): """ Try to import data from text. diff --git a/product/ERP5/Document/Telephone.py b/product/ERP5/Document/Telephone.py index 9d57bca370..c29cc05ed5 100644 --- a/product/ERP5/Document/Telephone.py +++ b/product/ERP5/Document/Telephone.py @@ -30,6 +30,7 @@ from AccessControl import ClassSecurityInfo from Products.ERP5Type import Permissions, PropertySheet from Products.ERP5Type.Base import Base +from Products.ERP5Type.Utils import deprecated from Products.ERP5.Document.Coordinate import Coordinate import re diff --git a/product/ERP5/Document/Url.py b/product/ERP5/Document/Url.py index 30f0508b71..1cd7723899 100644 --- a/product/ERP5/Document/Url.py +++ b/product/ERP5/Document/Url.py @@ -31,6 +31,7 @@ from AccessControl import ClassSecurityInfo from Products.CMFCore.utils import getToolByName from Products.ERP5Type import Permissions, PropertySheet from Products.ERP5Type.Base import Base +from Products.ERP5Type.Utils import deprecated from Products.ERP5.Document.Coordinate import Coordinate from Products.ERP5.mixin.url import UrlMixin, no_crawl_protocol_list,\ no_host_protocol_list, default_protocol_dict @@ -71,6 +72,7 @@ class Url(Coordinate, Base, UrlMixin): return self.getUrlString() security.declareProtected(Permissions.ModifyPortalContent, 'fromText') + @deprecated def fromText(self, text): """ Sets url_string a.k.a. scheme-specific-part of a URL -- 2.30.9