mirror of
https://github.com/jupyter/notebook.git
synced 2025-02-05 12:19:58 +08:00
Simplify encoding/decoding URL parts
This commit is contained in:
parent
adb2fc1fa4
commit
213b89c1cc
@ -65,19 +65,11 @@ class NotebookManager(LoggingConfigurable):
|
||||
|
||||
def url_encode(self, path):
|
||||
parts = path.split('/')
|
||||
path=""
|
||||
for part in parts:
|
||||
part = quote(part)
|
||||
path = os.path.join(path,part)
|
||||
return path
|
||||
return os.path.join(*[quote(p) for p in parts])
|
||||
|
||||
def url_decode(self, path):
|
||||
parts = path.split('/')
|
||||
path=""
|
||||
for part in parts:
|
||||
part = unquote(part)
|
||||
path = os.path.join(path,part)
|
||||
return path
|
||||
return os.path.join(*[unquote(p) for p in parts])
|
||||
|
||||
def _notebook_dir_changed(self, new):
|
||||
"""do a bit of validation of the notebook dir"""
|
||||
|
Loading…
Reference in New Issue
Block a user