mirror of
https://github.com/pret/pokemon-reverse-engineering-tools.git
synced 2026-09-26 19:40:56 -05:00
move mkdir_p out of gfx.py and into helpers.py
It seems that mkdir_p is unused at the moment.
This commit is contained in:
@@ -12,18 +12,6 @@ import trainers
|
||||
if __name__ != "__main__":
|
||||
rom = crystal.load_rom()
|
||||
|
||||
def mkdir_p(path):
|
||||
"""
|
||||
Make a directory at a given path.
|
||||
"""
|
||||
try:
|
||||
os.makedirs(path)
|
||||
except OSError as exc: # Python >2.5
|
||||
if exc.errno == errno.EEXIST:
|
||||
pass
|
||||
else: raise
|
||||
|
||||
|
||||
def hex_dump(input, debug=True):
|
||||
"""
|
||||
Display hex dump in rows of 16 bytes.
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"""
|
||||
Generic functions that should be reusable anywhere in pokemontools.
|
||||
"""
|
||||
import os
|
||||
|
||||
def index(seq, f):
|
||||
"""return the index of the first item in seq
|
||||
@@ -27,3 +28,14 @@ def flattener(x):
|
||||
def flatten(x):
|
||||
"flattens a list of sublists into just one list"
|
||||
return list(flattener(x))
|
||||
|
||||
def mkdir_p(path):
|
||||
"""
|
||||
Make a directory at a given path.
|
||||
"""
|
||||
try:
|
||||
os.makedirs(path)
|
||||
except OSError as exc: # Python >2.5
|
||||
if exc.errno == errno.EEXIST:
|
||||
pass
|
||||
else: raise
|
||||
|
||||
Reference in New Issue
Block a user