summaryrefslogtreecommitdiff
path: root/mapnames.py
diff options
context:
space:
mode:
authorLivio Recchia <recchialivio@libero.it>2020-02-10 23:06:34 +0100
committerLivio Recchia <recchialivio@libero.it>2020-02-10 23:06:34 +0100
commit9a13903a2f7d3a65fdf15a65fb59cccd622e2066 (patch)
tree9403b7dff39eb5e5d7fa0f79efb69b496add4c4b /mapnames.py
parent11cc316b74d5f3f283413a33e7693b314741aa4a (diff)
downloadmanachat-9a13903a2f7d3a65fdf15a65fb59cccd622e2066.tar.gz
manachat-9a13903a2f7d3a65fdf15a65fb59cccd622e2066.tar.bz2
manachat-9a13903a2f7d3a65fdf15a65fb59cccd622e2066.tar.xz
manachat-9a13903a2f7d3a65fdf15a65fb59cccd622e2066.zip
Initial commit
Diffstat (limited to 'mapnames.py')
-rw-r--r--mapnames.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/mapnames.py b/mapnames.py
new file mode 100644
index 0000000..5c01280
--- /dev/null
+++ b/mapnames.py
@@ -0,0 +1,19 @@
+
+map_names = {}
+
+
+def read_map_names(file='mapnames.txt'):
+ with open(file) as f:
+ for l in f.readlines():
+ try:
+ index = l.index(' ')
+ map_id = l[:index]
+ map_name = l[index + 1:-1]
+ map_names[map_id] = map_name
+ except ValueError:
+ pass
+
+ return map_names
+
+if len(map_names) < 1:
+ read_map_names()