Skip to content

Commit

Permalink
works
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardobranco777 committed Sep 8, 2023
1 parent 57f8a7e commit a3fba0f
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions bugme.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,16 @@ def get_item(string: str) -> Union[Item, None]:
return Item(host="bugzilla.suse.com", id=int(string.split("#", 1)[1]))
if string.startswith("poo#"):
return Item(host="progress.opensuse.org", id=int(string.split("#", 1)[1]))
repo, issue = string.split("#", 2)[1:]
if string.startswith("gh#"):
return Item(host="github.com", repo=repo, id=int(issue))
if string.startswith("gl#"):
return Item(host="gitlab.com", repo=repo, id=int(issue))
if string.startswith("gsd#"):
return Item(host="gitlab.suse.de", repo=repo, id=int(issue))
code, repo, issue = string.split("#", 2)
code_to_host = {
"gh": "github.com",
"gl": "gitlab.com",
"gsd": "gitlab.suse.de",
}
try:
return Item(host=code_to_host[code], repo=repo, id=int(issue))
except KeyError:
logging.error("Unsupported %s", string)
return None


Expand Down

0 comments on commit a3fba0f

Please sign in to comment.