Skip to content

Commit

Permalink
proposed code to enable Windows Spatialite
Browse files Browse the repository at this point in the history
  • Loading branch information
hcarter333 committed Apr 28, 2024
1 parent 2ecab32 commit 32fc6e8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions datasette/utils/__init__.py
Expand Up @@ -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)
Expand Down

0 comments on commit 32fc6e8

Please sign in to comment.