-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
101 lines (80 loc) · 2.23 KB
/
config.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
"""
Config 2024-01-18 4:40 p.m.
Part of the pyrdle wordle program.
Tom Legrady - [email protected]
(c) 2024 Tom Legrady - All Rights Reserved
"""
from enum import Enum
import tkinter as tk
class Config(Enum):
ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
ALPHA_BORDER_WIDTH = 5
ALPHA_HEIGHT = 1
ALPHA_INSERT_AT = tk.END
ALPHA_PACK_SIDE = tk.TOP
ALPHA_RELIEF = tk.FLAT
ALPHA_WIDTH = 26
BG_LETTER = "yellow"
BG_LOST = "red"
BG_NONE = "lightgrey"
BG_PLAY = "#9abdf5"
BG_POSITION = "green"
BG_WON = "green"
CHAR_HASH = "#"
CHAR_SPACE = " "
CHAR_UC_A = "A"
CHAR_NL = "\n"
DELETE_THESE = [
"alphabet",
"entry",
"score_display",
]
EMPTY_STRING = ""
EVAL_BG = "lightblue"
EVAL_HEIGHT = 1
EVAL_INDEX_START = "1."
EVAL_PACK_SIDE = tk.TOP
EVAL_STATE_DISABLED = tk.DISABLED
EVAL_STATE_ENABLED = "normal"
EVAL_WIDTH = 8
FINAL_MESSAGE = "The word was"
FONT_SIZE = ("Helvetica Bold", 16)
GAME_OVER_POPUP_TYPE = "INFO"
GAME_TITLE = "Pyrdle"
GEOMETRY = "375x500+200+200"
GEO_HEIGHT = 500
GEO_WIDTH = 375
MAX_GUESSES = 6
PAD_X = 10
PAD_Y = 10
RANDOM_WORD_URL = (
"https://random-word-api.herokuapp.com/word?number=1&length=6&lang=en"
)
QUIT_PACK_SIDE = tk.BOTTOM
QUIT_TEXT = "Quit"
QUIT_WIDTH = 14
REQUEST_ERROR_MESSAGE = "Error accessing random word"
REQUEST_TIMEOUT = 2
SCORE_DISPLAY_INITIAL_TEXT = "Won: 0 Lost: 0"
SCORE_DISPLAY_KEY_LOSSES = "losses"
SCORE_DISPLAY_KEY_WINS = "wins"
SCORE_DISPLAY_PACK_SIDE = tk.BOTTOM
SCORE_DISPLAY_RELIEF = tk.RIDGE
SCORE_DISPLAY_TEXT_FORMAT = "Won: {} Lost: {}"
SCORE_DISPLAY_WIDTH = 16
TAG_CENTER = "centered"
TAG_END_INDEX = "end"
TAG_START_INDEX = "1.0"
TEXT_ALIGN = "center"
TEXT_LAST_CHAR_INDEX = -1
USERINPUT_BORDER_WIDTH = 5
USERINPUT_EVENT = "<Return>"
USERINPUT_JUSTIFY = tk.CENTER
USERINPUT_PACK_SIDE = tk.TOP
USERINPUT_STATE_DISABLED = tk.DISABLED
USERINPUT_WIDTH = 8
USER_INPUT_TEXT_VALIDATE_CONDITION = "write"
WIDGETS = ("window", "alphabet")
WIDGETS_EVAL = (0, 1, 2, 3, 4, 5)
def __call__(tag):
return tag.value