Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
# reset local stuff
if opts._delete:
res = ontospy.actions_delete()
raise SystemExit(1)
# reset local stuff
if opts.erase:
ontospy.action_erase()
raise SystemExit(1)
# cache local ontologies
if opts.cache:
sTime = time.time()
ontospy.action_cache()
# finally: print(some stats....)
eTime = time.time()
tTime = eTime - sTime
printDebug("-" * 10)
printDebug("Time: %0.2fs" % tTime, "comment")
raise SystemExit(1)
printDebug("Note: no files have been moved or deleted (this has to be done manually)", "comment")
printDebug("----------\n" + "New location: '%s'" % _location, "important")
else:
printDebug("----------\n" + "Please specify an existing folder path.", "important")
raise SystemExit(1)
# reset local stuff
if opts._delete:
res = ontospy.actions_delete()
raise SystemExit(1)
# reset local stuff
if opts.erase:
ontospy.action_erase()
raise SystemExit(1)
# cache local ontologies
if opts.cache:
sTime = time.time()
ontospy.action_cache()
# finally: print(some stats....)
eTime = time.time()
tTime = eTime - sTime
printDebug("-" * 10)
printDebug("Time: %0.2fs" % tTime, "comment")
raise SystemExit(1)
def main():
""" command line script """
printDebug("OntoSpy " + ontospy.VERSION, "important")
printDebug("Local library: '%s'" % ontospy.get_home_location())
printDebug("------------")
opts, args = parse_options()
if not opts._setup:
ontospy.get_or_create_home_repo()
# move local lib
if opts._setup:
_location = args[0]
if _location.endswith("/"):
# dont need the final slash
_location = _location[:-1]
output = ontospy.action_update_library_location(_location)
if output:
printDebug("Note: no files have been moved or deleted (this has to be done manually)", "comment")
printDebug("----------\n" + "New location: '%s'" % _location, "important")
else:
printDebug("----------\n" + "Please specify an existing folder path.", "important")
raise SystemExit(1)
def main():
""" command line script """
printDebug("OntoSpy " + ontospy.VERSION, "important")
printDebug("Local library: '%s'" % ontospy.get_home_location())
printDebug("------------")
opts, args = parse_options()
if not opts._setup:
ontospy.get_or_create_home_repo()
# move local lib
if opts._setup:
_location = args[0]
if _location.endswith("/"):
# dont need the final slash
_location = _location[:-1]
output = ontospy.action_update_library_location(_location)
if output:
printDebug("Note: no files have been moved or deleted (this has to be done manually)", "comment")
def parse_options():
"""
parse_options() -> opts, args
Parse any command-line options given returning both
the parsed options and arguments.
https://docs.python.org/2/library/optparse.html
"""
parser = optparse.OptionParser(usage=USAGE, version=ontospy.VERSION)
parser.add_option("-c", "",
action="store_true", default=False, dest="cache",
help="CACHE: force caching of the local library (for faster loading).")
parser.add_option("-u", "",
action="store_true", default=False, dest="_setup",
help="UPDATE: enter new path for the local library.")
parser.add_option("-d", "",
action="store_true", default=False, dest="_delete",
help="DELETE: remove a single ontology file from the local library.")
parser.add_option("-e", "",
action="store_true", default=False, dest="erase",
def main():
""" command line script """
printDebug("OntoSpy " + ontospy.VERSION, "important")
printDebug("Local library: '%s'" % ontospy.get_home_location())
printDebug("------------")
opts, args = parse_options()
if not opts._setup:
ontospy.get_or_create_home_repo()
# move local lib
if opts._setup:
_location = args[0]
if _location.endswith("/"):
# dont need the final slash
_location = _location[:-1]
output = ontospy.action_update_library_location(_location)
if output:
printDebug("Note: no files have been moved or deleted (this has to be done manually)", "comment")
printDebug("----------\n" + "New location: '%s'" % _location, "important")