diff options
| author | 2015-05-01 18:11:25 +0200 | |
|---|---|---|
| committer | 2015-05-01 18:11:25 +0200 | |
| commit | c126f738bd5be581d5321521eedc9b14a8165a0e (patch) | |
| tree | 418989bfa81bfd30085f09102df53f6f58b00f14 /pyload/webui/app/json.py | |
| parent | Use 'import' instead 'from' (1) (diff) | |
| download | pyload-c126f738bd5be581d5321521eedc9b14a8165a0e.tar.xz | |
Use 'import' instead 'from' (2)
Diffstat (limited to 'pyload/webui/app/json.py')
| -rw-r--r-- | pyload/webui/app/json.py | 13 | 
1 files changed, 7 insertions, 6 deletions
| diff --git a/pyload/webui/app/json.py b/pyload/webui/app/json.py index 3b72cb7ce..400eba624 100644 --- a/pyload/webui/app/json.py +++ b/pyload/webui/app/json.py @@ -2,15 +2,16 @@  from __future__ import with_statement +import shutil +import traceback +  from os.path import join -from traceback import print_exc -from shutil import copyfileobj  from bottle import route, request, HTTPError +from pyload.utils import decode, formatSize  from pyload.webui import PYLOAD  from pyload.webui.app.utils import login_required, render_to_response, toDict -from pyload.utils import decode, formatSize  def format_time(seconds): @@ -60,7 +61,7 @@ def links():          data = {'links': links, 'ids': ids}          return data      except Exception, e: -        print_exc() +        traceback.print_exc()          return HTTPError() @@ -113,7 +114,7 @@ def package(id):          return data      except Exception: -        print_exc() +        traceback.print_exc()          return HTTPError() @@ -167,7 +168,7 @@ def add_package():          fpath = join(PYLOAD.getConfigValue("general", "download_folder"), "tmp_" + f.filename)          with open(fpath, 'wb') as destination: -            copyfileobj(f.file, destination) +            shutil.copyfileobj(f.file, destination)          links.insert(0, fpath)      except Exception:          pass | 
