summaryrefslogtreecommitdiff
path: root/qml/python/board.py
diff options
context:
space:
mode:
authorSébastien Dailly <sebastien@chimrod.com>2015-02-17 21:49:00 +0100
committerSébastien Dailly <sebastien@chimrod.com>2015-03-19 05:52:45 +0100
commitf07882d76d1221c1a60e016429212abb07fd9db1 (patch)
treeab8089321e6482df58c8e5d44638e1f88872f4ee /qml/python/board.py
parent5049d4c8a05d3f9b72f4c7e048e94b753713beda (diff)
Level navigation tree0.0.1
Load Level collection
Diffstat (limited to 'qml/python/board.py')
-rw-r--r--qml/python/board.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/qml/python/board.py b/qml/python/board.py
index 5bc0ac5..19f720a 100644
--- a/qml/python/board.py
+++ b/qml/python/board.py
@@ -2,6 +2,7 @@
# -*- coding: utf-8 -*-
import os
+import os.path
try:
import pyotherside
except:
@@ -22,7 +23,10 @@ def setPath(qtPath):
def loadBoard(filename):
global cursor
- sgfPath = os.path.join(path,"../content","sgf",filename);
+ if os.path.isfile(filename):
+ sgfPath = filename
+ else:
+ sgfPath = os.path.join(path,"../content","sgf",filename);
pyotherside.send('log', sgfPath)
try:
f = open(sgfPath)
@@ -48,7 +52,6 @@ def getGame(n):
game = Game(cursor)
game.normalize()
- pyotherside.send('log', "Game loaded !!")
return {
"tree": game.tree,