import urlparse
ugettext = mg_globals.thread_scope.translations.ugettext
ungettext = mg_globals.thread_scope.translations.ungettext
+
+
+def py2_unicode(klass):
+ if not PY3:
+ klass.__unicode__ = klass.__str__
+ klass.__str__ = lambda self: self.__unicode__().encode('utf-8')
+ return klass
import shutil
import tempfile
+import six
+
+from mediagoblin._compat import py2_unicode
# Actual workbench stuff
# ----------------------
+
+@py2_unicode
class Workbench(object):
"""
Represent the directory for the workbench
"""
self.dir = dir
- def __unicode__(self):
- return unicode(self.dir)
-
def __str__(self):
- return str(self.dir)
+ return six.text_type(self.dir)
def __repr__(self):
try: