summaryrefslogtreecommitdiffstats
path: root/ipalib/text.py
diff options
context:
space:
mode:
authorJason Gerard DeRose <jderose@redhat.com>2010-02-08 05:03:28 -0700
committerRob Crittenden <rcritten@redhat.com>2010-02-12 17:07:37 -0500
commit069763c5c616221fd0bcea813cad93ae3f7c072d (patch)
tree3c7944836ca68119671482e3ee2f9365032fa640 /ipalib/text.py
parent338578d10ac0978a00948971a17a89dc95435954 (diff)
downloadfreeipa-069763c5c616221fd0bcea813cad93ae3f7c072d.tar.gz
freeipa-069763c5c616221fd0bcea813cad93ae3f7c072d.tar.xz
freeipa-069763c5c616221fd0bcea813cad93ae3f7c072d.zip
Add Object.label class attribute, enable in webUI
Diffstat (limited to 'ipalib/text.py')
-rw-r--r--ipalib/text.py20
1 files changed, 17 insertions, 3 deletions
diff --git a/ipalib/text.py b/ipalib/text.py
index 0c8684025..07f1b21dd 100644
--- a/ipalib/text.py
+++ b/ipalib/text.py
@@ -26,10 +26,25 @@ placeholders for the rest of the code.
class LazyText(object):
- def __init__(self, domain, localedir):
+ def __init__(self, domain=None, localedir=None):
self.domain = domain
self.localedir = localedir
+ def __mod__(self, kw):
+ return self.__unicode__() % kw
+
+
+class FixMe(LazyText):
+ def __init__(self, msg):
+ self.msg = msg
+ super(FixMe, self).__init__()
+
+ def __repr__(self):
+ return '%s(%r)' % (self.__class__.__name__, self.msg)
+
+ def __unicode__(self):
+ return u'<%s>' % self.msg
+
class Gettext(LazyText):
def __init__(self, msg, domain, localedir):
@@ -39,8 +54,7 @@ class Gettext(LazyText):
def __unicode__(self):
return self.msg.decode('utf-8')
- def __mod__(self, value):
- return self.__unicode__() % value
+
class NGettext(LazyText):