How to use the ontospy.core.ontospy.action_update_library_location function in ontospy

To help you get started, we’ve selected a few ontospy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github lambdamusic / Ontospy / ontospy / core / main-manager.py View on Github external
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)


	# reset local stuff
	if opts._delete:
		res = ontospy.actions_delete()
		raise SystemExit(1)

	# reset local stuff
	if opts.erase: