-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathproject.py
More file actions
20 lines (14 loc) · 453 Bytes
/
project.py
File metadata and controls
20 lines (14 loc) · 453 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from gitbug.bug import Bug
from typing import Optional
class Project(object):
def __init__(self, pid: str) -> None:
self.pid = pid
self.bugs = {}
def add_bug(self, bug: Bug) -> None:
self.bugs[bug.bid] = bug
def get_bug(self, bid: str) -> Optional[Bug]:
return self.bugs[bid]
def get_bugs(self) -> list:
return list(self.bugs.values())
def __str__(self) -> str:
return self.name