Browse Source

debugging use of new chunk object

master
poikilos 9 years ago
committed by Jacob Gustafson
parent
commit
d5b935cf96
  1. 16
      chunkymap-regen.py

16
chunkymap-regen.py

@ -803,6 +803,8 @@ class MTChunks:
if os.path.isfile(tmp_png_path): if os.path.isfile(tmp_png_path):
os.remove(tmp_png_path) os.remove(tmp_png_path)
subprocess.call(cmd_string, shell=True) # TODO: remember not to allow arbitrary command execution, which could happen if input contains ';' when using shell=True subprocess.call(cmd_string, shell=True) # TODO: remember not to allow arbitrary command execution, which could happen if input contains ';' when using shell=True
self.prepare_chunk_meta(chunk_luid) # DOES load existing yml if exists
this_chunk = self.chunks[chunk_luid] this_chunk = self.chunks[chunk_luid]
if os.path.isfile(tmp_png_path): if os.path.isfile(tmp_png_path):
result = True result = True
@ -825,10 +827,10 @@ class MTChunks:
print (min_indent+"WARNING: no chunk data though traversed by player:") print (min_indent+"WARNING: no chunk data though traversed by player:")
print(min_indent+"standard output stream:") print(min_indent+"standard output stream:")
line_count = print_file(genresult_path, min_indent+" ") line_count = print_file(genresult_path, min_indent+" ")
#if line_count>0: if line_count>0:
#print(min_indent+" #EOF: "+str(line_count)+" line(s) in '"+genresult_path+"'") print(min_indent+" #EOF: "+str(line_count)+" line(s) in '"+genresult_path+"'")
# pass pass
#else: else:
print(min_indent+" #EOF: "+str(line_count)+" line(s) in '"+genresult_path+"'") print(min_indent+" #EOF: "+str(line_count)+" line(s) in '"+genresult_path+"'")
subprocess.call(cmd_no_out_string+" 2> \""+genresult_path+"\"", shell=True) subprocess.call(cmd_no_out_string+" 2> \""+genresult_path+"\"", shell=True)
print(min_indent+"standard error stream:") print(min_indent+"standard error stream:")
@ -837,7 +839,11 @@ class MTChunks:
print(min_indent+" #EOF: "+str(line_count)+" line(s) in '"+genresult_path+"'") print(min_indent+" #EOF: "+str(line_count)+" line(s) in '"+genresult_path+"'")
print(min_indent+" (done output of '"+cmd_no_out_string+"')") print(min_indent+" (done output of '"+cmd_no_out_string+"')")
try: try:
self.prepare_chunk_meta(chunk_luid) # DOES load existing yml if exists if os.path.exists(tmp_png_path):
os.rename(tmp_png_path, dest_png_path)
except:
pass
try:
#this_chunk = MTChunk() #this_chunk = MTChunk()
#this_chunk.luid = chunk_luid #this_chunk.luid = chunk_luid

Loading…
Cancel
Save