Compare commits
No commits in common. "main" and "devel" have entirely different histories.
|
@ -1,2 +0,0 @@
|
||||||
__pycache__/
|
|
||||||
*.pyc
|
|
|
@ -1,3 +0,0 @@
|
||||||
from cli import main
|
|
||||||
|
|
||||||
main()
|
|
|
@ -1,2 +0,0 @@
|
||||||
import argparse
|
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
class GiteaIssue:
|
|
||||||
|
|
|
@ -1,35 +0,0 @@
|
||||||
from urllib.parse import urlparse
|
|
||||||
|
|
||||||
def urlparse_w(url):
|
|
||||||
parseresult = urlparse(url)
|
|
||||||
splitted_path = parseresult.path.split('/')
|
|
||||||
|
|
||||||
# add some more metadata
|
|
||||||
gitea_username = splitted_path[1]
|
|
||||||
gitea_reponame = splitted_path[2]
|
|
||||||
|
|
||||||
return {
|
|
||||||
"raw": parseresult,
|
|
||||||
"username": gitea_username,
|
|
||||||
"reponame": gitea_reponame,
|
|
||||||
}
|
|
||||||
|
|
||||||
class GiteaRepo:
|
|
||||||
def __init__(self, urlspec):
|
|
||||||
"""
|
|
||||||
Return a GiteaRepo from a urlspec (see urllib.parse.ParseResult) and some other metadata
|
|
||||||
|
|
||||||
For implementation details, see urlparse_w.
|
|
||||||
|
|
||||||
If you want to take an actual url, use the .from_url classmethod.
|
|
||||||
"""
|
|
||||||
self.urlspec = urlspec
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def from_url(cls, url):
|
|
||||||
"""
|
|
||||||
Return a GiteaRepo from a url.
|
|
||||||
"""
|
|
||||||
|
|
||||||
parsed = urlparse_w(url)
|
|
||||||
return cls(parsed)
|
|
Loading…
Reference in New Issue