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:
Bryan Bishop
2013-09-01 16:04:50 -05:00
parent abd5264a9d
commit 5507494a35
2 changed files with 12 additions and 12 deletions

View File

@@ -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.

View File

@@ -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