lib + cmds.projects: Use lib.Uri
Remove the feeble attempts at unifying URI handling, and use class Uri from lib.Uri instead.
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
f0eeb14a97
commit
d9746cd20b
8 changed files with 65 additions and 98 deletions
|
|
@ -2,9 +2,9 @@
|
|||
|
||||
import re, os
|
||||
from argparse import Namespace, ArgumentParser
|
||||
from urllib.parse import urlparse
|
||||
|
||||
from ...lib.log import *
|
||||
from ...lib.Uri import Uri
|
||||
from ..Cmd import Cmd
|
||||
from ..CmdProjects import CmdProjects
|
||||
|
||||
|
|
@ -39,10 +39,10 @@ class CmdGetAuthInfo(Cmd): # export
|
|||
for line in remotes.splitlines():
|
||||
name, url, typ = re.split(r'\s+', line)
|
||||
if name == 'origin' and typ in ['(pull)', '(fetch)']: # TODO: Use other remotes, too?
|
||||
parsed = urlparse(url)
|
||||
parsed = Uri(url)
|
||||
for key in keys:
|
||||
result[key] = getattr(parsed, key)
|
||||
base = parsed.geturl()
|
||||
base = parsed.to_string
|
||||
base = re.sub(r'/jw-pkg', '', base)
|
||||
base = re.sub(r'/proj$', '', base)
|
||||
base = re.sub(r'/proj$', '', base)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue