Skip to content

Commit 88697cc

Browse files
authored
Update branches
1 parent 0b61505 commit 88697cc

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

interface_wrapper.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@ def __init__(self, title: str, content: str):
6565
def __repr__(self):
6666
return f"WikiPage(title={self.title}, content={self.content[:50]}...)" # Ограничиваем вывод content для удобства
6767

68+
class Branch:
69+
def __init__(self, name: str, last_commit: Optional[Commit] = None):
70+
self.name = name
71+
self.last_commit = last_commit
72+
73+
def __repr__(self):
74+
return f"Branch(name={self.name}, last_commit={self.last_commit})"
75+
6876
# Интерфейс API
6977
class IRepositoryAPI(ABC):
7078
@abstractmethod
@@ -92,10 +100,16 @@ def get_pull_requests(self, repo: Repository) -> List[PullRequest]:
92100
"""Получить список pull requests для репозитория."""
93101
pass
94102

103+
@abstractmethod
104+
def get_branches(self, repo: Repository) -> List[Branch]:
105+
"""Получить список веток для репозитория."""
106+
pass
107+
95108
@abstractmethod
96109
def get_wiki_pages(self, repo: Repository) -> List[WikiPage]:
97110
"""Получить список wiki-страниц для репозитория."""
98111
pass
112+
99113

100114
# Фабрика для создания API
101115
class RepositoryFactory:

0 commit comments

Comments
 (0)