Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/toisto-proto.py
diff options
context:
space:
mode:
authorTuukka Hastrup <Tuukka.Hastrup@iki.fi>2010-07-02 04:27:47 (GMT)
committer Tuukka Hastrup <Tuukka.Hastrup@iki.fi>2010-07-02 04:27:47 (GMT)
commit42df0c9fc62226bc05807fed9ed44cbaa60411c0 (patch)
tree4ccb3dab24c5b768ca74528442c702e3a11f25df /toisto-proto.py
parent7a0c594b306009c277fe585dd95f28a0a068dcb4 (diff)
start data for some new languages, make it possible to choose oneHEADmaster
Diffstat (limited to 'toisto-proto.py')
-rwxr-xr-xtoisto-proto.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/toisto-proto.py b/toisto-proto.py
index b4c8512..bf60eff 100755
--- a/toisto-proto.py
+++ b/toisto-proto.py
@@ -22,7 +22,12 @@ OLPC_CROSS = 259
OLPC_SQUARE = 263
OLPC_CHECK = 257
-with file("data/ipa/index") as infile:
+try:
+ LANGUAGE = sys.argv[1]
+except IndexError:
+ LANGUAGE = "ipa"
+
+with file("data/%s/index" % LANGUAGE) as infile:
lines = infile.read().decode("utf-8").split("\n")
entries = [line.split() for line in lines if line]
@@ -66,7 +71,7 @@ class Game(object):
def stats(self):
gametime = time.time() - self.time0
return ["This is a prototype",
- "Language: IPA",
+ "Language: %s" % LANGUAGE,
"Game time: %d:%02d" % (gametime / 60, gametime % 60),
"Score: %d" % self.score,
"Questions: %d" % self.round,