summaryrefslogtreecommitdiffstats
path: root/module/Utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/Utils.py')
-rw-r--r--module/Utils.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/module/Utils.py b/module/Utils.py
index 939baad96..3919b5ff0 100644
--- a/module/Utils.py
+++ b/module/Utils.py
@@ -32,6 +32,12 @@ def removeChars(string, repl):
elif type(string) == unicode:
return string.translate(dict([(ord(s), None) for s in repl]))
+def save_path(name):
+ #remove some chars
+ if os.name == 'nt':
+ return removeChars(name, '/\\?%*:|"<>')
+ else:
+ return removeChars(name, '/\\"')
def save_join(*args):
""" joins a path, encoding aware """
@@ -76,9 +82,9 @@ def compare_time(start, end):
if start == end: return True
now = list(time.localtime()[3:5])
- if start < now and end > now: return True
+ if start < now < end: return True
elif start > end and (now > start or now < end): return True
- elif start < now and end < now and start > end: return True
+ elif start < now > end < start: return True
else: return False