From 971754eba93701cfb22bc4399a37debf238eddf1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 12 May 2015 22:25:39 +0200 Subject: General fixup (1) --- pyload/utils/__init__.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'pyload/utils/__init__.py') 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: -- cgit v1.2.3