From 32fc6e87b19a880e958176d172e61963e922f333 Mon Sep 17 00:00:00 2001 From: antigrav_kids Date: Sat, 27 Apr 2024 23:29:48 -0700 Subject: [PATCH] proposed code to enable Windows Spatialite --- datasette/utils/__init__.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/datasette/utils/__init__.py b/datasette/utils/__init__.py index e110891119..bdeb6e5a3f 100644 --- a/datasette/utils/__init__.py +++ b/datasette/utils/__init__.py @@ -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)