[py3k] Replace 'unicode' with 'cubicweb._' (closes #7794111)
authorRémi Cardona <remi.cardona@logilab.fr>
Wed, 16 Sep 2015 10:29:42 +0200
changeset 347 5926af2f084e
parent 346 bc416e82ec14
child 348 8671ed1f8f91
[py3k] Replace 'unicode' with 'cubicweb._' (closes #7794111)
migration/postcreate.py
schema.py
views/boxes.py
views/entry.py
--- a/migration/postcreate.py	Wed Oct 21 12:15:41 2015 +0200
+++ b/migration/postcreate.py	Wed Sep 16 10:29:42 2015 +0200
@@ -1,5 +1,10 @@
 # postcreate script. You could setup a workflow here for example
 
+try:
+    from cubicweb import _
+except ImportError:
+    _ = unicode
+
 # BlogEntry workflow
 bwf = add_workflow(_('default BlogEntry workflow'), 'BlogEntry')
 
--- a/schema.py	Wed Oct 21 12:15:41 2015 +0200
+++ b/schema.py	Wed Sep 16 10:29:42 2015 +0200
@@ -1,6 +1,12 @@
+try:
+    from cubicweb import _
+except ImportError:
+    _ = unicode
+
 from yams.buildobjs import EntityType, String, RichString, SubjectRelation, RelationDefinition
 from cubicweb.schema import WorkflowableEntityType, ERQLExpression
 
+
 class Blog(EntityType):
     title = String(maxsize=50, required=True)
     description = RichString()
--- a/views/boxes.py	Wed Oct 21 12:15:41 2015 +0200
+++ b/views/boxes.py	Wed Sep 16 10:29:42 2015 +0200
@@ -5,7 +5,11 @@
 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
 """
 __docformat__ = "restructuredtext en"
-_ = unicode
+
+try:
+    from cubicweb import _
+except ImportError:
+    _ = unicode
 
 from logilab.mtconverter import xml_escape
 
--- a/views/entry.py	Wed Oct 21 12:15:41 2015 +0200
+++ b/views/entry.py	Wed Sep 16 10:29:42 2015 +0200
@@ -6,6 +6,11 @@
 """
 __docformat__ = "restructuredtext en"
 
+try:
+    from cubicweb import _
+except ImportError:
+    _ = unicode
+
 import re
 
 from calendar import monthrange