summaryrefslogtreecommitdiffstats
path: root/app/backend.py
diff options
context:
space:
mode:
Diffstat (limited to 'app/backend.py')
-rw-r--r--app/backend.py15
1 files changed, 4 insertions, 11 deletions
diff --git a/app/backend.py b/app/backend.py
index 94e7c67..0f1b359 100644
--- a/app/backend.py
+++ b/app/backend.py
@@ -10,12 +10,12 @@ class Storage:
self.root = path_rel
def _join(self, *components):
- return os.path.join(self.path, *(ensureutf8(c) for c in components))
+ return os.path.join(self.path, *components)
def get_courses(self):
""" Lists all courses of a study """
- return [o.decode('utf-8') for o in os.listdir(self.path)
- if os.path.isdir(self._join(o))]
+ return [o for o in os.listdir(self.path)
+ if os.path.isdir(self._join(o))]
def exam_exists(self, course, year, name):
""" Exists if an exam (file) exists """
@@ -45,12 +45,5 @@ class Storage:
if year.isdigit():
# yield entries as tuples (name, path) grouped by years
func = partial(os.path.join, self.root, course, year)
- # filenames created by this app are always ascii-only, but let's
- # decode it nonetheless just to be sure...
- entries = [(f.decode('utf-8'), func(f)) for f in files]
+ entries = [(f, func(f)) for f in files]
yield (year, entries)
-
-def ensureutf8(s):
- if isinstance(s, unicode):
- return s.encode('utf-8')
- return s