projects
/
oweals
/
minetest.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
59c58f2
)
minetestmapper can be run from any directory
author
Giuseppe Bilotta
<giuseppe.bilotta@gmail.com>
Wed, 3 Aug 2011 06:37:56 +0000
(08:37 +0200)
committer
Giuseppe Bilotta
<giuseppe.bilotta@gmail.com>
Fri, 5 Aug 2011 06:45:15 +0000
(08:45 +0200)
If it doesn't find colors.txt locally, it looks for the one in the
directory of the script itself.
util/minetestmapper.py
patch
|
blob
|
history
diff --git
a/util/minetestmapper.py
b/util/minetestmapper.py
index cf2a5776d7625ae83f9057fe10f0446e7f913bc4..e13a1bdc34be194e51f138f60b6dab1e0ac90453 100755
(executable)
--- a/
util/minetestmapper.py
+++ b/
util/minetestmapper.py
@@
-152,7
+152,10
@@
if path[-1:] != "/" and path[-1:] != "\\":
# Load color information for the blocks.
colors = {}
-f = file("colors.txt")
+try:
+ f = file("colors.txt")
+except IOError:
+ f = file(os.path.join(os.path.dirname(__file__), "colors.txt"))
for line in f:
values = string.split(line)
colors[int(values[0], 16)] = (