mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Hoping this will allow github to resolve the merge conflict with master
This commit is contained in:
parent
3bd5e14bc1
commit
cbd0c014ec
1 changed files with 21 additions and 0 deletions
|
|
@ -261,6 +261,27 @@ def escape_sqlite(s):
|
||||||
return "[{}]".format(s)
|
return "[{}]".format(s)
|
||||||
|
|
||||||
|
|
||||||
|
_decode_path_component_re = re.compile(r"U\+([\da-h]{4})", re.IGNORECASE)
|
||||||
|
_encode_path_component_re = re.compile(
|
||||||
|
"[{}]".format(
|
||||||
|
"".join(
|
||||||
|
re.escape(c)
|
||||||
|
for c in (";", "/", "?", ":", "@", "&", "=", "+", "$", ",", "~")
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def decode_path_component(table_name):
|
||||||
|
return _decode_path_component_re.sub(lambda m: chr(int(m.group(1), 16)), table_name)
|
||||||
|
|
||||||
|
|
||||||
|
def encode_path_component(table_name):
|
||||||
|
return _encode_path_component_re.sub(
|
||||||
|
lambda m: "U+{0:0{1}x}".format(ord(m.group(0)), 4).upper(), table_name
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def make_dockerfile(
|
def make_dockerfile(
|
||||||
files,
|
files,
|
||||||
metadata_file,
|
metadata_file,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue