-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings.py
83 lines (51 loc) · 1.84 KB
/
settings.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
"""
.. data:: MAJOR_RELEASE_NUMBER
miniSQL major release version
.. data:: MINOR_RELEASE_NUMBER
miniSQL minor release version
.. data:: PATCH_RELEASE_NUMBER
miniSQL patch release version
.. data:: LOGO
miniSQL ascii logo
.. data:: DB_STORAGE_FILE
where database records stored
.. data:: DB_ALLOWED_FIELDS
allowed field names for a database record
.. data:: DB_RECORD_SIZE
number of bytes per record
.. data:: DB_RECORD_NAME_SIZE
size of field name in bytes
.. data:: DB_FIELD_DATA_SIZE
size of field data in bytes
.. data:: DB_ENCODING
encoding used for strings
.. data:: SHELL_INTRO
intro message displayed in minisql shell
.. data:: SHELL_PROMPT
user prompt displayed in minisql shell
.. data:: SHELL_HISTORY_FILE
stores minisql shell commands for command history lookup
.. data:: SHELL_HISTORY_LENGTH
number of lines of history to store
"""
MAJOR_RELEASE_NUMBER = 1
MINOR_RELEASE_NUMBER = 0
PATCH_RELEASE_NUMBER = 0
LOGO = (" _ _ _____ _____ __ \n"
" _____ |_| ___ |_|| __|| || | \n"
"| || || || ||__ || | || |__ \n"
"|_|_|_||_||_|_||_||_____||__ _||_____|\n"
" |__| \n")
DB_STORAGE_FILE = 'db.minisql'
DB_ALLOWED_FIELDS = {'a1', 'a2', 'a3', 'a4'}
DB_RECORD_SIZE = 40
DB_RECORD_NAME_SIZE = 18
DB_FIELD_DATA_SIZE = 4
DB_ENCODING = 'utf-8'
SHELL_INTRO = ("Welcome to the miniSQL shell! Your running Version ({major}.{minor}.{patch}).\n"
"Commands end with a ';' and support tab autocomplete and history (up/down keys).\n"
"Type 'h;' or 'help;' to list possible commands.\n".format(
major=MAJOR_RELEASE_NUMBER, minor=MINOR_RELEASE_NUMBER, patch=PATCH_RELEASE_NUMBER))
SHELL_PROMPT = "miniSQL> "
SHELL_HISTORY_FILE = "minisql_history"
SHELL_HISTORY_LENGTH = 1000