util.add_url_path
This commit is contained in:
parent
678d9e0e4d
commit
77e9dc6601
1 changed files with 7 additions and 0 deletions
|
@ -1,11 +1,18 @@
|
||||||
import os
|
import os
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
from urllib import urlparse, urlunparse
|
||||||
|
|
||||||
import env
|
import env
|
||||||
from rwx import fs
|
from rwx import fs
|
||||||
from rwx.log import stream as log
|
from rwx.log import stream as log
|
||||||
|
|
||||||
|
|
||||||
|
def add_url_path(url: str, extra_path: str) -> str:
|
||||||
|
parts = urlparse(url)
|
||||||
|
parts._replace(path=Path(parts.path) / extra_path)
|
||||||
|
return urlunparse(parts)
|
||||||
|
|
||||||
|
|
||||||
def browse(root: str) -> None:
|
def browse(root: str) -> None:
|
||||||
paths = []
|
paths = []
|
||||||
for directory, _, files in os.walk(root):
|
for directory, _, files in os.walk(root):
|
||||||
|
|
Loading…
Reference in a new issue