summaryrefslogtreecommitdiffstats
path: root/ipalib/config.py
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2010-02-22 14:29:26 -0500
committerRob Crittenden <rcritten@redhat.com>2010-02-26 12:31:11 -0500
commit766757e4d4d57c0dad881c1176ae318462203adc (patch)
treeaf1d917b1bba0db7f4405e5c7767d80b6fa1afa0 /ipalib/config.py
parent0700f4d7cae9b0b25214b117715dd91a6ccb1132 (diff)
downloadfreeipa-766757e4d4d57c0dad881c1176ae318462203adc.tar.gz
freeipa-766757e4d4d57c0dad881c1176ae318462203adc.tar.xz
freeipa-766757e4d4d57c0dad881c1176ae318462203adc.zip
Fix unicode failures in Env tests and dn failures in XML-RPC tests
Diffstat (limited to 'ipalib/config.py')
-rw-r--r--ipalib/config.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/ipalib/config.py b/ipalib/config.py
index 8597645a4..1dbd5b7ce 100644
--- a/ipalib/config.py
+++ b/ipalib/config.py
@@ -54,17 +54,17 @@ class Env(object):
>>> env = Env()
>>> env.attr = 'I was set as an attribute.'
>>> env.attr
- 'I was set as an attribute.'
+ u'I was set as an attribute.'
>>> env['attr'] # Also retrieve as a dictionary item
- 'I was set as an attribute.'
+ u'I was set as an attribute.'
Or you can set a variable as a dictionary item:
>>> env['item'] = 'I was set as a dictionary item.'
>>> env['item']
- 'I was set as a dictionary item.'
+ u'I was set as a dictionary item.'
>>> env.item # Also retrieve as an attribute
- 'I was set as a dictionary item.'
+ u'I was set as a dictionary item.'
The variable names must be valid lower-case Python identifiers that neither
start nor end with an underscore. If your variable name doesn't meet these
@@ -101,7 +101,7 @@ class Env(object):
>>> env.not_false = 'false' # Not equal to repr(False)!
>>> env.not_false
- 'false'
+ u'false'
If an ``str`` value looks like an integer, it's automatically converted to
the ``int`` type. Likewise, if an ``str`` value looks like a floating-point
@@ -119,7 +119,7 @@ class Env(object):
>>> env.message = ' Hello! ' # Surrounded by double spaces
>>> env.message
- 'Hello!'
+ u'Hello!'
>>> env.number = ' 42 ' # Still converted to an int
>>> env.number
42
@@ -140,7 +140,7 @@ class Env(object):
>>> env.date = 'Second'
Traceback (most recent call last):
...
- AttributeError: cannot override Env.date value 'First' with 'Second'
+ AttributeError: cannot override Env.date value u'First' with 'Second'
An `Env` instance can be *locked*, after which no further variables can be
set. Trying to set variables on a locked `Env` instance will also raise
@@ -400,7 +400,7 @@ class Env(object):
>>> env = Env()
>>> env.home = '/people/joe'
>>> env._join('home', 'Music', 'favourites')
- '/people/joe/Music/favourites'
+ u'/people/joe/Music/favourites'
"""
if key in self and self[key] is not None:
return path.join(self[key], *parts)