there is no os.touch

This commit is contained in:
yenatch
2013-05-12 10:22:24 -04:00
parent ce187ca03f
commit 05ceafe614

View File

@@ -1440,7 +1440,7 @@ def mass_to_colored_png(debug=False):
to_png(os.path.join(root, name), None, os.path.join(root, os.path.splitext(name)[0]+'.pal')) to_png(os.path.join(root, name), None, os.path.join(root, os.path.splitext(name)[0]+'.pal'))
else: else:
to_png(os.path.join(root, name)) to_png(os.path.join(root, name))
os.touch(os.path.join(root, name)) os.utime(os.path.join(root, name), None)
# only monster and trainer pics for now # only monster and trainer pics for now
for root, dirs, files in os.walk('../gfx/pics/'): for root, dirs, files in os.walk('../gfx/pics/'):
@@ -1451,14 +1451,14 @@ def mass_to_colored_png(debug=False):
to_png(os.path.join(root, name), None, os.path.join(root, 'normal.pal')) to_png(os.path.join(root, name), None, os.path.join(root, 'normal.pal'))
else: else:
to_png(os.path.join(root, name)) to_png(os.path.join(root, name))
os.touch(os.path.join(root, name)) os.utime(os.path.join(root, name), None)
for root, dirs, files in os.walk('../gfx/trainers/'): for root, dirs, files in os.walk('../gfx/trainers/'):
for name in files: for name in files:
if debug: print os.path.splitext(name), os.path.join(root, name) if debug: print os.path.splitext(name), os.path.join(root, name)
if os.path.splitext(name)[1] == '.2bpp': if os.path.splitext(name)[1] == '.2bpp':
to_png(os.path.join(root, name), None, os.path.join(root, name[:-5]+'.pal')) to_png(os.path.join(root, name), None, os.path.join(root, name[:-5]+'.pal'))
os.touch(os.path.join(root, name)) os.utime(os.path.join(root, name), None)
def mass_decompress(debug=False): def mass_decompress(debug=False):
@@ -1483,7 +1483,7 @@ def mass_decompress(debug=False):
else: else:
with open(os.path.join(root, name), 'rb') as lz: de = Decompressed(lz.read()) with open(os.path.join(root, name), 'rb') as lz: de = Decompressed(lz.read())
to_file(os.path.join(root, os.path.splitext(name)[0]+'.2bpp'), de.output) to_file(os.path.join(root, os.path.splitext(name)[0]+'.2bpp'), de.output)
os.touch(os.path.join(root, name)) os.utime(os.path.join(root, name), None)
def append_terminator_to_lzs(directory): def append_terminator_to_lzs(directory):
# fix lzs that were extracted with a missing terminator # fix lzs that were extracted with a missing terminator