-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathutils.py
45 lines (36 loc) · 1.03 KB
/
utils.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
38
39
40
41
42
43
44
45
# Standard library
import logging
import os
# Third-party
from github import Github
# First-party/Local
import log
logger = logging.getLogger("normalize_repos")
log.reset_handler()
GITHUB_ORGANIZATION = "creativecommons"
GITHUB_USERNAME = "cc-creativecommons-github-io-bot"
GITHUB_TOKEN = os.environ["ADMIN_GITHUB_TOKEN"]
COLORS = {
"UNFAVOURABLE": "b60205",
"NEGATIVE": "ff9f1c",
"NEUTRAL": "ffcc00",
"POSITIVE": "cfda2c",
"FAVOURABLE": "008672",
"BLACK": "000000",
"DARKER": "333333",
"DARK": "666666",
"MEDIUM": "999999",
"LIGHT": "cccccc",
"LIGHTER": "eeeeee",
"WHITE": "ffffff",
}
def set_up_github_client():
logger.log(logging.INFO, "Setting up GitHub client...")
github_client = Github(GITHUB_TOKEN)
logger.log(log.SUCCESS, "done.")
return github_client
def get_cc_organization(github_client):
logger.log(logging.INFO, "Getting CC's GitHub organization...")
cc = github_client.get_organization(GITHUB_ORGANIZATION)
logger.log(log.SUCCESS, "done.")
return cc