Skip to content

Commit 3ac3838

Browse files
committed
Extract common functionality into a utility module
1 parent e0258eb commit 3ac3838

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

normalize_repos/utils.py

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import os
2+
3+
# Third party
4+
from github import Github
5+
6+
7+
GITHUB_ORGANIZATION = "creativecommons"
8+
GITHUB_USERNAME = "cc-creativecommons-github-io-bot"
9+
GITHUB_TOKEN = os.environ["ADMIN_GITHUB_TOKEN"]
10+
11+
12+
COLORS = {
13+
'UNFAVOURABLE': 'b60205',
14+
'NEGATIVE': 'ff9f1c',
15+
'NEUTRAL': 'ffcc00',
16+
'POSITIVE': 'cfda2c',
17+
'FAVOURABLE': '008672',
18+
19+
'DARKER': '333333',
20+
'DARK': '666666',
21+
'MEDIUM': '999999',
22+
'LIGHT': 'cccccc',
23+
'LIGHTER': 'eeeeee',
24+
25+
'BLACK': '000000'
26+
}
27+
28+
29+
def set_up_github_client():
30+
print("Setting up GitHub client...")
31+
github_client = Github(GITHUB_TOKEN)
32+
return github_client
33+
34+
35+
def get_cc_organization(github_client):
36+
print("Getting CC's GitHub organization...")
37+
cc = github_client.get_organization(GITHUB_ORGANIZATION)
38+
return cc

0 commit comments

Comments
 (0)