mirror of
https://github.com/Threnklyn/dungeon-sheets.git
synced 2026-06-06 21:01:26 +02:00
turn off multiprocessing if debug
This commit is contained in:
@@ -438,7 +438,7 @@ def _make_pdf_pdftk(fields, src_pdf, basename, flatten=False):
|
|||||||
|
|
||||||
def make_sheet(character_file, character=None, flatten=False, fancy_decorations=False, debug=False):
|
def make_sheet(character_file, character=None, flatten=False, fancy_decorations=False, debug=False):
|
||||||
"""Prepare a PDF character sheet from the given character file.
|
"""Prepare a PDF character sheet from the given character file.
|
||||||
|
|
||||||
Parameters
|
Parameters
|
||||||
----------
|
----------
|
||||||
character_file : str
|
character_file : str
|
||||||
@@ -583,9 +583,12 @@ def main():
|
|||||||
filenames = [f for f in os.listdir('.') if os.path.splitext(f)[1] == '.py']
|
filenames = [f for f in os.listdir('.') if os.path.splitext(f)[1] == '.py']
|
||||||
else:
|
else:
|
||||||
filenames = [args.filename]
|
filenames = [args.filename]
|
||||||
|
if args.debug:
|
||||||
with Pool(cpu_count()) as p:
|
for filename in filenames:
|
||||||
p.starmap(_build, product(filenames, [args]))
|
_build(filename, args)
|
||||||
|
else:
|
||||||
|
with Pool(cpu_count()) as p:
|
||||||
|
p.starmap(_build, product(filenames, [args]))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|||||||
Reference in New Issue
Block a user