-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconstant.py
66 lines (59 loc) · 1.67 KB
/
constant.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
BOX_URL_TEMPLATE = "https://neulionmdnyc-a.akamaihd.net/fs/nba/feeds_s2012/stats/%d/boxscore/%s.js"
TEAM_DICT = {
"BOS": "Boston Celtics",
"BKN": "Brooklyn Nets",
"NYK": "New York Knicks",
"PHI": "Philadelphia 76ers",
"TOR": "Toronto Raptors",
"CHI": "Chicago Bulls",
"CLE": "Cleveland Cavaliers",
"DET": "Detroit Pistons",
"IND": "Indiana Pacers",
"MIL": "Milwaukee Bucks",
"ATL": "Atlanta Hawks",
"CHA": "Charlotte Hornets",
"MIA": "Miami Heat",
"ORL": "Orlando Magic",
"WAS": "Washington Wizards",
"GSW": "Golden State Warriors",
"LAC": "LA Clippers",
"LAL": "Los Angeles Lakers",
"PHX": "Phoenix Suns",
"SAC": "Sacramento Kings",
"DAL": "Dallas Mavericks",
"HOU": "Houston Rockets",
"MEM": "Memphis Grizzlies",
"NOP": "New Orleans Pelicans",
"SAS": "San Antonio Spurs",
"DEN": "Denver Nuggets",
"MIN": "Minnesota Timberwolves",
"OKC": "Oklahoma City Thunder",
"POR": "Portland Trail Blazers",
"UTA": "Utah Jazz"
}
class BoxColors(object):
CONTROL = '\033'
ENDC = '\033[m'
ESC = '\033'
CTRLU = '\x15'
STATS_HEADER = '[1;33;44m'
HOME_FRAME = '[1;31m'
HOME_HEADER = '[1;33;41m'
VISITOR_FRAME = '[1;35m'
VISITOR_HEADER = '[1;33;45m'
WHITE = '[1;37m'
GREEN = '[1;32m'
YELLOW = '[1;33m'
CYAN = '[1;36m'
RED = '[1;31m'
DARK_GREEN = '[32m'
END = '[m'
@classmethod
def set_control_code(cls, code):
if code not in [cls.ESC, cls.CTRLU]:
return
cls.CONTROL = code
cls.ENDC = cls.CONTROL + cls.END
@classmethod
def get_color_code(cls, color):
return cls.CONTROL + color