summaryrefslogtreecommitdiffstats
path: root/pyload/utils
diff options
context:
space:
mode:
Diffstat (limited to 'pyload/utils')
-rw-r--r--pyload/utils/__init__.py14
-rw-r--r--pyload/utils/packagetools.py2
-rw-r--r--pyload/utils/printer.py1
-rw-r--r--pyload/utils/pylgettext.py9
4 files changed, 14 insertions, 12 deletions
diff --git a/pyload/utils/__init__.py b/pyload/utils/__init__.py
index 648432c26..2e23bf99b 100644
--- a/pyload/utils/__init__.py
+++ b/pyload/utils/__init__.py
@@ -116,13 +116,17 @@ def compare_time(start, end):
start = map(int, start)
end = map(int, end)
- if start == end: return True
+ if start == end:
+ return True
now = list(time.localtime()[3:5])
- if start < now < end: return True
- elif start > end and (now > start or now < end): return True
- elif start < now > end < start: return True
- else: return False
+ if start < now < end:
+ return True
+ elif start > end and (now > start or now < end):
+ return True
+ elif start < now > end < start:
+ return True
+ return False
def formatSize(size):
diff --git a/pyload/utils/packagetools.py b/pyload/utils/packagetools.py
index 9dbde9b50..0ab68a869 100644
--- a/pyload/utils/packagetools.py
+++ b/pyload/utils/packagetools.py
@@ -136,7 +136,7 @@ def parseNames(files):
else:
name = ""
- # fallback: package by hoster
+ #@NOTE: fallback: package by hoster
if not name:
name = urlparse(file).netloc
if name:
diff --git a/pyload/utils/printer.py b/pyload/utils/printer.py
index 5d333e238..1122c7f4c 100644
--- a/pyload/utils/printer.py
+++ b/pyload/utils/printer.py
@@ -5,6 +5,7 @@ import colorama
colorama.init(autoreset=True)
+
def color(color, text):
return colorama.Fore.(c.upper())(text)
diff --git a/pyload/utils/pylgettext.py b/pyload/utils/pylgettext.py
index 0e3ebad80..86cfc586a 100644
--- a/pyload/utils/pylgettext.py
+++ b/pyload/utils/pylgettext.py
@@ -6,12 +6,10 @@ _searchdirs = None
origfind = find
+
def setpaths(pathlist):
global _searchdirs
- if isinstance(pathlist, list):
- _searchdirs = pathlist
- else:
- _searchdirs = list(pathlist)
+ _searchdirs = pathlist if isinstance(pathlist, list) else list(pathlist)
def addpath(path):
@@ -32,8 +30,7 @@ def delpath(path):
def clearpath():
global _searchdirs
- if _searchdirs is not None:
- _searchdirs = None
+ _searchdirs = None
def find(domain, localedir=None, languages=None, all=False):