~kernevil/ubuntu/saucy/pylons/fix-useless-import

« back to all changes in this revision

Viewing changes to pylons/i18n/translation.py

  • Committer: Bazaar Package Importer
  • Author(s): Piotr Ożarowski
  • Date: 2011-08-02 21:17:36 UTC
  • mfrom: (1.2.3 upstream) (10.1.3 experimental)
  • Revision ID: james.westby@ubuntu.com-20110802211736-ejqil9b3yqgxt6lr
Tags: 1.0-2
* Add ipython_0.11_compatibility patch (thanks to Julian Taylor)
* Add build-arch and build-indep targets to debian/rules 
* Switch from dh_pysupport to dh_python2
* Source format changed to 3.0 (quilt)
* Standards-Version bumped to 3.9.2 (no changes needed)

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
    def __mod__(self, other):
45
45
        return self.eval() % other
46
46
 
 
47
    def format(self, other):
 
48
        return self.eval().format(other)
 
49
 
47
50
 
48
51
def lazify(func):
49
52
    """Decorator to return a lazy-evaluated version of the original"""
152
155
        conf = kwargs.pop('pylons_config')
153
156
    else:
154
157
        conf = pylons.config.current_conf()
155
 
    # XXX: root_path is deprecated
156
 
    try:
157
 
        rootdir = conf['pylons.paths']['root']
158
 
    except KeyError:
159
 
        rootdir = conf['pylons.paths'].get('root_path')
160
 
    localedir = os.path.join(rootdir, 'i18n')
 
158
    localedir = os.path.join(conf['pylons.paths']['root'], 'i18n')
161
159
    if not isinstance(lang, list):
162
160
        lang = [lang]
163
161
    try: