mirror of
https://github.com/openSUSE/osc.git
synced 2025-11-09 07:33:16 +01:00
Change 'git-obs' to use owner/repo[#pull] arguments consistently
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
from typing import Optional
|
||||
from typing import Tuple
|
||||
|
||||
from .connection import Connection
|
||||
from .connection import GiteaHTTPResponse
|
||||
@@ -8,6 +10,16 @@ from .user import User
|
||||
|
||||
|
||||
class Repo:
|
||||
@classmethod
|
||||
def split_id(cls, repo_id: str) -> Tuple[str, str]:
|
||||
"""
|
||||
Split <owner>/<repo> into individual components and return them in a tuple.
|
||||
"""
|
||||
match = re.match(r"^([^/]+)/([^/]+)$", repo_id)
|
||||
if not match:
|
||||
raise ValueError(f"Invalid repo id: {repo_id}")
|
||||
return match.groups()
|
||||
|
||||
@classmethod
|
||||
def get(
|
||||
cls,
|
||||
|
||||
Reference in New Issue
Block a user