Files to database converter
[oweals/minetest.git] / util / minetestmapper.py
index 5b175512c4bb3ead8950ca06fe3a1fdc03afe869..e13a1bdc34be194e51f138f60b6dab1e0ac90453 100755 (executable)
@@ -1,5 +1,5 @@
-#!/usr/bin/python2
-# -*- coding: windows-1252 -*-
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
 
 # This program is free software. It comes without any warranty, to
 # the extent permitted by applicable law. You can redistribute it
@@ -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)] = (