proposed code to enable Windows Spatialite

This commit is contained in:
antigrav_kids 2024-04-27 23:29:48 -07:00
commit 32fc6e87b1

View file

@ -873,6 +873,15 @@ class LoadExtension(click.ParamType):
name = "path:entrypoint?"
def convert(self, value, param, ctx):
#:\ indicates we're on a Windows machine study the argument a bit more
if ":\\" in r"%r" % value:
path_entry = value.split(":", 2)
if len(path_entry) < 3:
return value
#argument contains a Windows/DOS path and an entry point
path = path_entry[0] + ":" + path_entry[1]
entrypoint = path_entry[-1]
return path, entrypoint
if ":" not in value:
return value
path, entrypoint = value.split(":", 1)