diff options
author | 2015-05-12 22:25:39 +0200 | |
---|---|---|
committer | 2015-05-12 22:25:39 +0200 | |
commit | 971754eba93701cfb22bc4399a37debf238eddf1 (patch) | |
tree | e3a36023f93b73a1621de0c6c9503ccbb301fb03 /pyload/utils | |
parent | Fix dict generators for python 2.5 (diff) | |
download | pyload-971754eba93701cfb22bc4399a37debf238eddf1.tar.xz |
General fixup (1)
Diffstat (limited to 'pyload/utils')
-rw-r--r-- | pyload/utils/__init__.py | 18 | ||||
-rw-r--r-- | pyload/utils/pylgettext.py | 1 |
2 files changed, 9 insertions, 10 deletions
diff --git a/pyload/utils/__init__.py b/pyload/utils/__init__.py index 3c525caeb..5ca4e4563 100644 --- a/pyload/utils/__init__.py +++ b/pyload/utils/__init__.py @@ -12,17 +12,15 @@ import sys import time import urllib -import pyload.utils.pylgettext as gettext +from pyload.utils import pylgettext as gettext # abstraction layer for json operations -from bottle import json_loads - - -def os.chmod(*args): - try: - os.chmod(*args) - except Exception: - pass +try: + import simplejson as json +except ImportError: + import json + +from bottle import json_loads, json_dumps def decode(string): @@ -252,7 +250,7 @@ def load_translation(name, locale, default="en"): import traceback try: - gettext.setpaths([join(os.sep, "usr", "share", "pyload", "locale"), None]) + gettext.setpaths([os.path.join(os.sep, "usr", "share", "pyload", "locale"), None]) translation = gettext.translation(name, os.path.join(pypath, "locale"), languages=[locale, default], fallback=True) except Exception: diff --git a/pyload/utils/pylgettext.py b/pyload/utils/pylgettext.py index 76bb268ec..fc83ac264 100644 --- a/pyload/utils/pylgettext.py +++ b/pyload/utils/pylgettext.py @@ -53,5 +53,6 @@ def find(domain, localedir=None, languages=None, all=False): else: return results + # Is there a smarter/cleaner pythonic way for this? translation.func_globals['find'] = find |