-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
37 lines (29 loc) · 1.31 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
from good_srp.client import GithubClient
from good_srp.repo.parser import RepositoryParser
from good_srp.repo.reports_generator import ReportsGenerator
from good_srp.repo.reports.html_generator import HTMLGenerator
from good_srp.repo.reports.markdown_generator import MarkdownGenerator
from good_srp.repo.reports.writer import ReportWriter
from good_srp.model_repo.member import Member
from good_srp.model_repo.manager import Manager
from good_srp.model_repo.owner import Owner
if __name__ == '__main__':
username = 'beatriz-cantilho'
response = GithubClient.get_repos_by_user(username)
if response['status_code'] == 200:
repositories = RepositoryParser.parse(response['body'])
markdown_report = ReportsGenerator.build(MarkdownGenerator, repositories)
html_report = ReportsGenerator.build(HTMLGenerator, repositories)
ReportWriter.write(markdown_report)
print(html_report)
print(markdown_report)
else:
print(response['body'])
member = Member('bcantilho', '[email protected]')
manager = Manager('cantilho', '[email protected]')
owner = Owner('cantilho', '[email protected]')
print(member.members())
print(owner.members())
#print(manager.members()) #It won't work on purpose
print(member.work())
print(manager.work())