summaryrefslogtreecommitdiffstats
path: root/module/web
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-08-27 17:07:33 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-08-27 17:07:33 +0200
commita33d8062833d1bfec4777145cc484c1d6b9e141f (patch)
tree7d815f80cdcced2d36144b9b71760278d29ed007 /module/web
parentlocale fixes (diff)
downloadpyload-a33d8062833d1bfec4777145cc484c1d6b9e141f.tar.xz
some automatic fixes
Diffstat (limited to 'module/web')
-rw-r--r--module/web/ajax/views.py4
-rw-r--r--module/web/media/default/js/sprintf.js2
-rw-r--r--module/web/pyload/views.py22
3 files changed, 14 insertions, 14 deletions
diff --git a/module/web/ajax/views.py b/module/web/ajax/views.py
index 82e478af3..7d5c1884c 100644
--- a/module/web/ajax/views.py
+++ b/module/web/ajax/views.py
@@ -59,7 +59,7 @@ def add_package(request):
try:
f = request.FILES['add_file']
- if name == None or name == "":
+ if name is None or name == "":
name = f.name
fpath = join(settings.PYLOAD.get_conf_val("general","download_folder"), "tmp_"+ f.name)
@@ -71,7 +71,7 @@ def add_package(request):
except:
pass
- if name == None or name == "":
+ if name is None or name == "":
return HttpResponseServerError()
links = map(lambda x: x.strip(), links)
diff --git a/module/web/media/default/js/sprintf.js b/module/web/media/default/js/sprintf.js
index 30d9046de..385285340 100644
--- a/module/web/media/default/js/sprintf.js
+++ b/module/web/media/default/js/sprintf.js
@@ -35,7 +35,7 @@ sprintfWrapper = {
min: match[6] || 0,
precision: match[8],
code: match[9] || '%',
- negative: parseInt(arguments[convCount]) < 0 ? true : false,
+ negative: parseInt(arguments[convCount]) < 0,
argument: String(arguments[convCount])
};
}
diff --git a/module/web/pyload/views.py b/module/web/pyload/views.py
index 615840428..dd367f7f3 100644
--- a/module/web/pyload/views.py
+++ b/module/web/pyload/views.py
@@ -186,8 +186,8 @@ def download(request, path):
@check_server
def logs(request, item=-1):
- perpage = request.session.get('perpage', 34);
- reversed = request.session.get('reversed', False);
+ perpage = request.session.get('perpage', 34)
+ reversed = request.session.get('reversed', False)
warning = ""
conf = settings.PYLOAD.get_config()
@@ -195,7 +195,7 @@ def logs(request, item=-1):
warning = "Warning: File log is disabled, see settings page."
perpage_p = ((20,20), (34, 34), (40, 40), (100, 100), (0,'all'))
- fro = None;
+ fro = None
if request.method == 'POST':
try:
@@ -230,8 +230,8 @@ def logs(request, item=-1):
counter = 0
perpagecheck = 0
for l in log:
- counter = counter+1;
-
+ counter = counter+1
+
if counter >= item:
try:
date,time,level,message = l.split(" ", 3)
@@ -241,18 +241,18 @@ def logs(request, item=-1):
date = '?'
time = ' '
level = '?'
- message = l;
- if item == -1 and dtime != None and fro <= dtime:
+ message = l
+ if item == -1 and dtime is not None and fro <= dtime:
item = counter #found our datetime
if item >= 0:
data.append({'line': counter, 'date': date+" "+time, 'level':level, 'message': message})
- perpagecheck = perpagecheck +1;
- if fro == None and dtime != None: #if fro not set set it to first showed line
- fro = dtime;
+ perpagecheck = perpagecheck +1
+ if fro is None and dtime is not None: #if fro not set set it to first showed line
+ fro = dtime
if perpagecheck >= perpage and perpage > 0:
break
- if fro == None: #still not set, empty log?
+ if fro is None: #still not set, empty log?
fro = datetime.now()
if reversed:
data.reverse()