summaryrefslogtreecommitdiffstats
path: root/module/config/converter.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/config/converter.py')
-rw-r--r--module/config/converter.py26
1 files changed, 0 insertions, 26 deletions
diff --git a/module/config/converter.py b/module/config/converter.py
deleted file mode 100644
index f3b4dc327..000000000
--- a/module/config/converter.py
+++ /dev/null
@@ -1,26 +0,0 @@
-# -*- coding: utf-8 -*-
-
-from module.utils import decode
-
-def to_string(value):
- return str(value) if not isinstance(value, basestring) else value
-
-# cast value to given type, unicode for strings
-def from_string(value, typ=None):
-
- # value is no string
- if not isinstance(value, basestring):
- return value
-
- value = decode(value)
-
- if typ == "int":
- return int(value)
- elif typ == "bool":
- return True if value.lower() in ("1", "true", "on", "an", "yes") else False
- elif typ == "time":
- if not value: value = "0:00"
- if not ":" in value: value += ":00"
- return value
- else:
- return value \ No newline at end of file