Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
G,
config = config
)
Profile.verbosePrint("");
pf.output(
outputType = outputType,
directory = outputDir,
style = style,
color = color,
parallel = parallel
)
except Exception as e:
Profile.verbosePrint("=> an error occured: {0} of type {1}".format(e, type(e)))
Profile.verbosePrint(traceback.format_exc())
except:
Profile.verbosePrint("could not read {0}".format(file))
Profile.verbosePrint("\n")
else:
Profile.verbosePrint("skipping {0} as it does not match filePattern".format(file))
if not recursive:
break
print("Done")
config = config
)
Profile.verbosePrint("");
pf.output(
outputType = outputType,
directory = outputDir,
style = style,
color = color,
parallel = parallel
)
except Exception as e:
Profile.verbosePrint("=> an error occured: {0} of type {1}".format(e, type(e)))
Profile.verbosePrint(traceback.format_exc())
except:
Profile.verbosePrint("could not read {0}".format(file))
Profile.verbosePrint("\n")
else:
Profile.verbosePrint("skipping {0} as it does not match filePattern".format(file))
if not recursive:
break
print("Done")
try:
pf = Profile.create(
G,
config = config
)
Profile.verbosePrint("");
pf.output(
outputType = outputType,
directory = outputDir,
style = style,
color = color,
parallel = parallel
)
except Exception as e:
Profile.verbosePrint("=> an error occured: {0} of type {1}".format(e, type(e)))
Profile.verbosePrint(traceback.format_exc())
except:
Profile.verbosePrint("could not read {0}".format(file))
Profile.verbosePrint("\n")
else:
Profile.verbosePrint("skipping {0} as it does not match filePattern".format(file))
if not recursive:
break
print("Done")
if not os.path.isdir(outputDir):
os.mkdir(outputDir)
for (dirpath, dirnames, filenames) in os.walk(inputDir):
for filename in filenames:
file = dirpath + "/" + filename
if fnmatch.fnmatch(filename, filePattern):
Profile.verbosePrint("\n[ " + file + " ]")
try:
G = kit.readGraph(file, graphFormat)
try:
pf = Profile.create(
G,
config = config
)
Profile.verbosePrint("");
pf.output(
outputType = outputType,
directory = outputDir,
style = style,
color = color,
parallel = parallel
)
except Exception as e:
Profile.verbosePrint("=> an error occured: {0} of type {1}".format(e, type(e)))
Profile.verbosePrint(traceback.format_exc())
except:
Profile.verbosePrint("could not read {0}".format(file))
Profile.verbosePrint("\n")
else:
Profile.verbosePrint("skipping {0} as it does not match filePattern".format(file))
if not recursive:
parallel: run some additional parts of the generation in parallel (experimental)
graphFormat: format of matching files (e.g.: Format.METIS)
"""
# if no custom config is given, use a preconfigured config according to preset name
if not config:
config = Config.createConfig(preset)
if not os.path.isdir(outputDir):
os.mkdir(outputDir)
for (dirpath, dirnames, filenames) in os.walk(inputDir):
for filename in filenames:
file = dirpath + "/" + filename
if fnmatch.fnmatch(filename, filePattern):
Profile.verbosePrint("\n[ " + file + " ]")
try:
G = kit.readGraph(file, graphFormat)
try:
pf = Profile.create(
G,
config = config
)
Profile.verbosePrint("");
pf.output(
outputType = outputType,
directory = outputDir,
style = style,
color = color,
parallel = parallel
)
except Exception as e: