- import refactoring
authorborax
Thu, 13 Aug 2009 17:14:09 +0200
changeset 8 455b16a502c4
parent 7 1d29e2389bd3
child 9 0da25ed2e320
- import refactoring
ztfy/utils/__init__.py
ztfy/utils/request.py
ztfy/utils/timezone.py
ztfy/utils/unicode.py
--- a/ztfy/utils/__init__.py	Thu Aug 13 00:23:45 2009 +0200
+++ b/ztfy/utils/__init__.py	Thu Aug 13 17:14:09 2009 +0200
@@ -12,14 +12,7 @@
 # FOR A PARTICULAR PURPOSE.
 #
 ##############################################################################
-"""
 
-$Id: $
-"""
-
-__version__   = "$Revision: $"
-__release__   = "$Id: $"
-__docformat__ = "restructuredtext"
 
 from zope.i18nmessageid import MessageFactory
 _ = MessageFactory('ztfy.utils')
--- a/ztfy/utils/request.py	Thu Aug 13 00:23:45 2009 +0200
+++ b/ztfy/utils/request.py	Thu Aug 13 17:14:09 2009 +0200
@@ -63,5 +63,6 @@
 
 
 def setRequestData(key, data, request=None):
+    """Define request data, stored into request annotations"""
     annotations = getRequestAnnotations(request)
     annotations[key] = data
--- a/ztfy/utils/timezone.py	Thu Aug 13 00:23:45 2009 +0200
+++ b/ztfy/utils/timezone.py	Thu Aug 13 17:14:09 2009 +0200
@@ -24,14 +24,14 @@
 import pytz
 
 # import Zope3 interfaces
-from zope.interface import implementer
 from zope.interface.common.idatetime import ITZInfo
 from zope.publisher.interfaces.browser import IBrowserRequest
 
 # import local interfaces
 
 # import Zope3 packages
-from zope import component
+from zope.component import adapter
+from zope.interface import implementer
 
 # import local packages
 
@@ -41,7 +41,7 @@
 tz = _tz
 
 @implementer(ITZInfo)
-@component.adapter(IBrowserRequest)
+@adapter(IBrowserRequest)
 def tzinfo(request=None):
      return tz
 
--- a/ztfy/utils/unicode.py	Thu Aug 13 00:23:45 2009 +0200
+++ b/ztfy/utils/unicode.py	Thu Aug 13 17:14:09 2009 +0200
@@ -15,8 +15,8 @@
 
 
 # import standard packages
+import codecs
 import string
-import codecs
 
 # import Zope3 interfaces
 
@@ -83,7 +83,7 @@
 
 
 def translateString(s, escapeSlashes=False, forceLower=True) :
-    """Remove extended characters from string
+    """Remove extended characters from string and replace them with 'basic' ones
     
     @param s: text to be cleaned.
     @type s: str or unicode