mirror of
https://github.com/simonw/datasette.git
synced 2026-06-03 07:37:00 +02:00
proposed code to enable Windows Spatialite
This commit is contained in:
parent
2ecab3213c
commit
32fc6e87b1
1 changed files with 9 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue