From f07882d76d1221c1a60e016429212abb07fd9db1 Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Tue, 17 Feb 2015 21:49:00 +0100 Subject: Level navigation tree Load Level collection --- qml/python/configuration.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 qml/python/configuration.py (limited to 'qml/python/configuration.py') diff --git a/qml/python/configuration.py b/qml/python/configuration.py new file mode 100644 index 0000000..e2cd826 --- /dev/null +++ b/qml/python/configuration.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import os +import os.path + +try: + import pyotherside +except: + print("no pyotherside module loaded") + +def get_level_desc(path): + return {"name": os.path.basename(path), + "path": path, + } + +def get_levels(qtPath, documents): + + pyotherside.send('log', documents) + + level_path = os.path.join(qtPath, "../content", "sgf") + provided_levels = [get_level_desc(os.path.join(level_path, f)) for f in os.listdir(level_path)] + + return provided_levels + -- cgit v1.2.3