Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CS Fancy Clock
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TheJoeCoder
CS Fancy Clock
Commits
e30a7025
Verified
Commit
e30a7025
authored
10 months ago
by
TheJoeCoder
Browse files
Options
Downloads
Patches
Plain Diff
Make config file better
parent
7ed27584
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
config.py
+40
-18
40 additions, 18 deletions
config.py
with
41 additions
and
18 deletions
.gitignore
+
1
−
0
View file @
e30a7025
...
...
@@ -127,3 +127,4 @@ dmypy.json
cython_debug/
module_config.json
hw_config.json
\ No newline at end of file
This diff is collapsed.
Click to expand it.
config.py
+
40
−
18
View file @
e30a7025
PROP_SCREEN_WIDTH
=
240
PROP_SCREEN_HEIGHT
=
280
import
os.path
import
json
default_config
=
{
"
screen_width
"
:
240
,
"
screen_height
"
:
280
,
"
window_fullscreen
"
:
True
,
"
hide_mouse
"
:
True
,
"
window_scale
"
:
2
,
"
leds_driver
"
:
"
npixel
"
,
"
leds_location
"
:
"
D12
"
,
"
leds_length
"
:
15
,
"
flask_debug
"
:
False
,
"
flask_host
"
:
"
0.0.0.0
"
,
"
flask_port
"
:
5000
}
config
=
default_config
.
copy
()
if
os
.
path
.
exists
(
"
config.json
"
):
with
open
(
"
config.json
"
,
"
r
"
)
as
f
:
config
.
update
(
json
.
load
(
f
))
with
open
(
"
config.json
"
,
"
w
"
)
as
f
:
json
.
dump
(
config
,
f
,
indent
=
4
)
PROP_SCREEN_WIDTH
=
config
[
"
screen_width
"
]
PROP_SCREEN_HEIGHT
=
config
[
"
screen_height
"
]
PROP_WINDOW_FULLSCREEN
=
config
[
"
window_fullscreen
"
]
PROP_HIDE_MOUSE
=
config
[
"
hide_mouse
"
]
PROP_WINDOW_FULLSCREEN
=
False
# Make the window scale larger for development
PROP_WINDOW_SCALE
=
config
[
"
window_scale
"
]
PROP_HIDE_MOUSE
=
False
PROP_FLASK_DEBUG
=
config
[
"
flask_debug
"
]
PROP_FLASK_HOST
=
config
[
"
flask_host
"
]
PROP_FLASK_PORT
=
config
[
"
flask_port
"
]
PROP_LEDS_DRIVER
=
config
[
"
leds_driver
"
]
PROP_LEDS_LOCATION
=
config
[
"
leds_location
"
]
PROP_LEDS_LENGTH
=
config
[
"
leds_length
"
]
# Make the window scale larger for development
PROP_WINDOW_SCALE
=
3
PROP_AVAILABLE_WIDGETS
=
[
"
IPShowWidget
"
,
...
...
@@ -19,15 +53,3 @@ PROP_AVAILABLE_PATTERNS = [
"
RainbowPattern
"
,
"
SolidColorPattern
"
]
PROP_FLASK_DEBUG
=
False
PROP_FLASK_HOST
=
"
0.0.0.0
"
PROP_FLASK_PORT
=
5000
PROP_LEDS_DRIVER
=
"
dummy
"
PROP_LEDS_LOCATION
=
""
PROP_LEDS_LENGTH
=
15
# PROP_LEDS_DRIVER="npixel"
# PROP_LEDS_LOCATION="D12"
# PROP_LEDS_LENGTH = 15
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment