.
This commit is contained in:
12
gui/utils.py
12
gui/utils.py
@@ -8,23 +8,23 @@ import logging
|
|||||||
|
|
||||||
def nassi(input_path: str, output_path: str, outputname: str, gui, behaviour: Overwrite_behaviour, font_filepath: Optional[str]=None):
|
def nassi(input_path: str, output_path: str, outputname: str, gui, behaviour: Overwrite_behaviour, font_filepath: Optional[str]=None):
|
||||||
NSD = NassiShneidermanDiagram(gui.debug_mode)
|
NSD = NassiShneidermanDiagram(gui.debug_mode)
|
||||||
directory = output_path + '/' + outputname
|
output_directory = output_path + '/' + outputname
|
||||||
|
|
||||||
if font_filepath != None:
|
if font_filepath != None:
|
||||||
NSD.set_font(font_filepath)
|
NSD.set_font(font_filepath)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if not os.path.exists(directory):
|
if not os.path.exists(output_directory):
|
||||||
os.makedirs(directory)
|
os.makedirs(output_directory)
|
||||||
except OSError:
|
except OSError:
|
||||||
logging.error('Error: Creating directory. ' + directory)
|
logging.error('Error: Creating directory. ' + output_directory)
|
||||||
except:
|
except:
|
||||||
raise
|
raise
|
||||||
|
|
||||||
NSD.load_from_file(input_path)
|
NSD.load_from_file(input_path)
|
||||||
NSD.convert_to_image(directory, on_conflict=behaviour, x_size=750)
|
NSD.convert_to_image(output_directory, on_conflict=behaviour, x_size=750)
|
||||||
|
|
||||||
return directory
|
return output_directory
|
||||||
|
|
||||||
|
|
||||||
def output(folder):
|
def output(folder):
|
||||||
|
|||||||
Reference in New Issue
Block a user