Browse Source

list comprehension and prefer HOME

changes were suggested by kwolekr on github.com/expertmm/minetest/utils
pull request (prefer HOME since he says HOME may exist on Windows under
certain configurations)
master
poikilos 8 years ago
committed by Jacob Gustafson
parent
commit
3e39a0b56d
  1. 10
      minetestmapper-expertmm.py

10
minetestmapper-expertmm.py

@ -224,9 +224,7 @@ if geometry_string is not None:
coords_string, width_string, height_string = parts coords_string, width_string, height_string = parts
coords = coords_string.split(":") coords = coords_string.split(":")
if len(coords) == 2: if len(coords) == 2:
x_string, z_string = coords x, z = [int(coord) for coord in coords]
x = int(x_string)
z = int(z_string)
this_width = int(width_string) this_width = int(width_string)
this_height = int(height_string) this_height = int(height_string)
nonchunky_xmin = x nonchunky_xmin = x
@ -293,10 +291,10 @@ colors = {}
colors_path = "colors.txt" colors_path = "colors.txt"
profile_path = None profile_path = None
if 'USERPROFILE' in os.environ: if 'HOME' in os.environ:
profile_path = os.environ['USERPROFILE']
elif 'HOME' in os.environ:
profile_path = os.environ['HOME'] profile_path = os.environ['HOME']
elif 'USERPROFILE' in os.environ:
profile_path = os.environ['USERPROFILE']
mt_path = None mt_path = None
mt_util_path = None mt_util_path = None

Loading…
Cancel
Save