Add auto folder creation to HHC
Contributed by grindi on 2+2 http://forumserver.twoplustwo.com/showpost.php?p=12156328&postcount=1666 Creates the sub folders of hhArchiveBase for placing the converted files in.
This commit is contained in:
@@ -57,6 +57,10 @@ class HandHistoryConverter():
|
|||||||
self.out_fh = sys.stdout
|
self.out_fh = sys.stdout
|
||||||
else:
|
else:
|
||||||
# TODO: out_path should be sanity checked.
|
# TODO: out_path should be sanity checked.
|
||||||
|
out_dir = os.path.dirname(self.out_path)
|
||||||
|
if not os.path.isdir(out_dir):
|
||||||
|
logging.info("Creatin directory '%s'" % out_dir)
|
||||||
|
os.makedirs(out_dir)
|
||||||
self.out_fh = open(self.out_path, 'w')
|
self.out_fh = open(self.out_path, 'w')
|
||||||
|
|
||||||
self.sitename = sitename
|
self.sitename = sitename
|
||||||
|
|||||||
Reference in New Issue
Block a user