diff options
author | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-05-12 22:25:39 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-05-12 22:25:39 +0200 |
commit | 971754eba93701cfb22bc4399a37debf238eddf1 (patch) | |
tree | e3a36023f93b73a1621de0c6c9503ccbb301fb03 /pyload/utils/__init__.py | |
parent | Fix dict generators for python 2.5 (diff) | |
download | pyload-971754eba93701cfb22bc4399a37debf238eddf1.tar.xz |
General fixup (1)
Diffstat (limited to 'pyload/utils/__init__.py')
-rw-r--r-- | pyload/utils/__init__.py | 18 |
1 files changed, 8 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: |