Author: jmorliaguet
Date: Tue Nov  1 19:12:59 2005
New Revision: 28868

Modified:
   z3lab/z3ecm/trunk/src/ecm/cpsskins/example1/README.txt
   z3lab/z3ecm/trunk/src/ecm/cpsskins/example1/hello.py
   z3lab/z3ecm/trunk/src/ecm/cpsskins/example2/README.txt
   z3lab/z3ecm/trunk/src/ecm/cpsskins/example2/text.py
   z3lab/z3ecm/trunk/src/ecm/cpsskins/example3/items.py
   z3lab/z3ecm/trunk/src/ecm/cpsskins/example4/actions.py
   z3lab/z3ecm/trunk/src/ecm/cpsskins/example6/counter.py
Log:

- unicode fixes



Modified: z3lab/z3ecm/trunk/src/ecm/cpsskins/example1/README.txt
==============================================================================
--- z3lab/z3ecm/trunk/src/ecm/cpsskins/example1/README.txt      (original)
+++ z3lab/z3ecm/trunk/src/ecm/cpsskins/example1/README.txt      Tue Nov  1 
19:12:59 2005
@@ -86,7 +86,7 @@
     >>> class HelloPortlet(Persistent, Contained):
     ...     implements(IHelloPortlet)
     ...
-    ...     def __init__(self, title=''):
+    ...     def __init__(self, title=u''):
     ...         self.title = title
 
 You may also simply make your portlet subclass cpsskins.Portlet
@@ -96,7 +96,7 @@
     >>> class HelloPortlet(cpsskins.Portlet):
     ...     implements(IHelloPortlet)
     ...
-    ...     def __init__(self, title=''):
+    ...     def __init__(self, title=u''):
     ...         self.title = title
 
 
@@ -127,7 +127,7 @@
     >>> class HelloPortlet(Portlet):
     ...     implements(IHelloPortlet)
     ...
-    ...     def __init__(self, title=''):
+    ...     def __init__(self, title=u''):
     ...         self.title = title
     ...
     ...     def __call__(self, info):

Modified: z3lab/z3ecm/trunk/src/ecm/cpsskins/example1/hello.py
==============================================================================
--- z3lab/z3ecm/trunk/src/ecm/cpsskins/example1/hello.py        (original)
+++ z3lab/z3ecm/trunk/src/ecm/cpsskins/example1/hello.py        Tue Nov  1 
19:12:59 2005
@@ -32,7 +32,7 @@
     """
     implements(IHelloPortlet)
 
-    def __init__(self, title=''):
+    def __init__(self, title=u''):
         self.title = title
 
     def __call__(self, info):

Modified: z3lab/z3ecm/trunk/src/ecm/cpsskins/example2/README.txt
==============================================================================
--- z3lab/z3ecm/trunk/src/ecm/cpsskins/example2/README.txt      (original)
+++ z3lab/z3ecm/trunk/src/ecm/cpsskins/example2/README.txt      Tue Nov  1 
19:12:59 2005
@@ -115,14 +115,14 @@
 'text' field to generate the markup. This is done with::
 
     def __call__(self, info):
-        return unicode(self.text)
+        return self.text
 
 But when a Text portlet is first instanciated the 'text' value is an empty
 string. Since you don't want the portlet to be invisible you should add a
 condition to make sure that the portlet always returns some markup::
 
     def __call__(self, info):
-        return unicode(self.text) or u"Please enter some text."
+        return self.text or u"Please enter some text."
 
 Remember that portlets are expected to return unicode strings as markup.
 
@@ -135,12 +135,12 @@
     ...     """
     ...     implements(ITextPortlet)
 
-    ...     def __init__(self, title='', text=''):
+    ...     def __init__(self, title=u'', text=u''):
     ...         self.title = title
     ...         self.text = text
 
     ...     def __call__(self, info):
-    ...         return unicode(self.text) or u"Please enter some text."
+    ...         return self.text or u"Please enter some text."
 
 
 

Modified: z3lab/z3ecm/trunk/src/ecm/cpsskins/example2/text.py
==============================================================================
--- z3lab/z3ecm/trunk/src/ecm/cpsskins/example2/text.py (original)
+++ z3lab/z3ecm/trunk/src/ecm/cpsskins/example2/text.py Tue Nov  1 19:12:59 2005
@@ -37,9 +37,9 @@
     """
     implements(ITextPortlet)
 
-    def __init__(self, title='', text=''):
+    def __init__(self, title=u'', text=u''):
         self.title = title
         self.text = text
 
     def __call__(self, info):
-        return unicode(self.text) or u"Please enter some text."
+        return self.text or u"Please enter some text."

Modified: z3lab/z3ecm/trunk/src/ecm/cpsskins/example3/items.py
==============================================================================
--- z3lab/z3ecm/trunk/src/ecm/cpsskins/example3/items.py        (original)
+++ z3lab/z3ecm/trunk/src/ecm/cpsskins/example3/items.py        Tue Nov  1 
19:12:59 2005
@@ -33,7 +33,7 @@
     """
     implements(IItemsPortlet)
 
-    def __init__(self, title=''):
+    def __init__(self, title=u''):
         self.title = title
 
     def __call__(self, info):

Modified: z3lab/z3ecm/trunk/src/ecm/cpsskins/example4/actions.py
==============================================================================
--- z3lab/z3ecm/trunk/src/ecm/cpsskins/example4/actions.py      (original)
+++ z3lab/z3ecm/trunk/src/ecm/cpsskins/example4/actions.py      Tue Nov  1 
19:12:59 2005
@@ -40,7 +40,7 @@
     """
     implements(IActionsPortlet)
 
-    def __init__(self, title='', category='zmi_actions'):
+    def __init__(self, title=u'', category=u'zmi_actions'):
         self.title = title
         self.category = category
 

Modified: z3lab/z3ecm/trunk/src/ecm/cpsskins/example6/counter.py
==============================================================================
--- z3lab/z3ecm/trunk/src/ecm/cpsskins/example6/counter.py      (original)
+++ z3lab/z3ecm/trunk/src/ecm/cpsskins/example6/counter.py      Tue Nov  1 
19:12:59 2005
@@ -35,7 +35,7 @@
     """
     implements(ICounterPortlet)
 
-    def __init__(self, title=''):
+    def __init__(self, title=u''):
         self.title = title
 
     def __call__(self, info):
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to