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:
Jan Lindemann 2026-04-27 09:37:28 +02:00
commit d9746cd20b
Signed by: Jan Lindemann
GPG key ID: 3750640C9E25DD61
8 changed files with 65 additions and 98 deletions

View file

@ -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)