Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if args.loglevel:
logmap={
'debug':logging.DEBUG,
'info':logging.INFO,
'warn':logging.WARN,
'error':logging.ERROR
}
tts.logger().setLevel(logmap[args.loglevel])
else:
tts.logger().setLevel(logging.WARN)
# load filesystem values
if args.directory:
self.filesystem = tts.filesystem.FileSystem(os.path.abspath(args.directory))
else:
self.filesystem = tts.get_default_fs()
if (args.parser=='list' or args.parser=='export') and not args.save_type:
# set default
args.save_type = tts.SaveType.workshop
if (args.parser=='config' and args.parser_config=='set' and not args.mod_location and not args.tts_location):
#parser_config.print_usage()
parser_config_set.error("At least one of -m or -t is required.")
rc,message = args.func(args)
if message:
print(message)
sys.exit(rc)
def get_filesystem(self):
if self.locationIsUser:
return tts.get_default_fs()
return tts.filesystem.FileSystem(tts_install_path=self.TTSLocation)
def reload_filesystem(self):
if self.preferences.locationIsUser:
self.filesystem=tts.get_default_fs()
else:
self.filesystem=tts.filesystem.FileSystem(tts_install_path=self.preferences.TTSLocation)