Browse Source

remove some hard tabs

master
poikilos 9 years ago
committed by Jacob Gustafson
parent
commit
0507c93e80
  1. 40
      replace-with-current-user.py

40
replace-with-current-user.py

@ -19,26 +19,26 @@ if "\\" not in home_minetest_chunkymap_path:
if os.path.isdir(home_minetest_chunkymap_path): if os.path.isdir(home_minetest_chunkymap_path):
for filename in filenames: for filename in filenames:
file_path = os.path.join(home_minetest_chunkymap_path, filename) file_path = os.path.join(home_minetest_chunkymap_path, filename)
if os.path.isfile(file_path): if os.path.isfile(file_path):
temp_path = file_path+".tmp" temp_path = file_path+".tmp"
os.rename(file_path, temp_path) os.rename(file_path, temp_path)
if not os.path.isfile(file_path): if not os.path.isfile(file_path):
ins = open(temp_path, 'r') ins = open(temp_path, 'r')
outs = open(file_path, 'w') outs = open(file_path, 'w')
line = True line = True
while line: while line:
line = ins.readline() line = ins.readline()
if line: if line:
line = line.replace("/home/owner", home_path) line = line.replace("/home/owner", home_path)
outs.write(line+"\n") outs.write(line+"\n")
outs.close() outs.close()
os.remove(temp_path) os.remove(temp_path)
ins.close() ins.close()
else: else:
print "FAILED to rewrite the file '"+file_path+"' (to change minetest util path to '"+home_minetest_chunkymap_path+"')--perhaps it is in use. Make the file writeable then try running "+__FILE__+" again." print "FAILED to rewrite the file '"+file_path+"' (to change minetest util path to '"+home_minetest_chunkymap_path+"')--perhaps it is in use. Make the file writeable then try running "+__FILE__+" again."
input("Press enter to continue...") input("Press enter to continue...")
else: else:
print "SKIPPED "+filename+" since not installed (probably ok since deprecated files are still listed here)" print "SKIPPED "+filename+" since not installed (probably ok since deprecated files are still listed here)"
else: else:
print "FAILED to find '"+home_minetest_chunkymap_path+"'" print "FAILED to find '"+home_minetest_chunkymap_path+"'"
print "Please install a compatible version of minetest-server package, run minetestserver once, then if you were running a chunkymap installer that called this py file, re-run that installer (otherwise re-run this script if you are sure that installer was successful)." print "Please install a compatible version of minetest-server package, run minetestserver once, then if you were running a chunkymap installer that called this py file, re-run that installer (otherwise re-run this script if you are sure that installer was successful)."

Loading…
Cancel
Save