Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/atoidejouer/tools/storage.py
diff options
context:
space:
mode:
Diffstat (limited to 'atoidejouer/tools/storage.py')
-rw-r--r--atoidejouer/tools/storage.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/atoidejouer/tools/storage.py b/atoidejouer/tools/storage.py
index e96327c..6db569e 100644
--- a/atoidejouer/tools/storage.py
+++ b/atoidejouer/tools/storage.py
@@ -34,6 +34,33 @@ def get_config_path():
return os.path.join(_bundle_path, 'static', 'data', 'config', 'config.ini')
+def list_sequence_names(type_):
+ # init result
+ _names = list()
+ # prepare dir path
+ _seq_dir = os.path.join(activity.get_activity_root(), 'data',
+ 'sequences', type_)
+ # ..
+ for _filename in os.listdir(_seq_dir):
+ # ..
+ _path = os.path.join(_seq_dir, _filename)
+ # little check
+ if os.path.isfile(_path):
+ # check name
+ try:
+ _n, _ext = os.path.splitext(_filename)
+ # check ext
+ if _ext == '.seq':
+ _names.append((_n, _path))
+ else:
+ continue
+ except Exception, e:
+ # TODO log something
+ continue
+ # ..
+ return _names
+
+
def get_sequence_items(sequence_path):
if os.path.exists(sequence_path):
_f = open(sequence_path)