bepasty-server
bepasty-server copied to clipboard
Use module instead of class for flask configuration
Flask supports module as objects for configuration abilities.
This will allow easier user overrides as they won't need to manipulate the class into a data configuration file.
Also added a bit of refactoring to change Config
-> settings
.
settings
seems to be the preferred technical term in the documentations.
https://flask.palletsprojects.com/en/2.0.x/config/#configuring-from-python-files
Codecov Report
Merging #275 (0723957) into master (c40d55d) will decrease coverage by
0.53%
. The diff coverage is58.06%
.
:exclamation: Current head 0723957 differs from pull request most recent head ffc0c20. Consider uploading reports for the commit ffc0c20 to get more accurate results
@@ Coverage Diff @@
## master #275 +/- ##
==========================================
- Coverage 71.38% 70.84% -0.54%
==========================================
Files 44 44
Lines 2558 2593 +35
==========================================
+ Hits 1826 1837 +11
- Misses 732 756 +24
Impacted Files | Coverage Δ | |
---|---|---|
src/bepasty/cli/object.py | 0.00% <0.00%> (ø) |
|
src/bepasty/cli/server.py | 0.00% <ø> (ø) |
|
src/bepasty/tests/screenshots.py | 0.00% <0.00%> (ø) |
|
src/bepasty/utils/formatters.py | 15.15% <0.00%> (ø) |
|
src/bepasty/views/display.py | 16.83% <0.00%> (ø) |
|
src/bepasty/views/upload.py | 20.95% <0.00%> (ø) |
|
src/bepasty/wsgi.py | 0.00% <ø> (ø) |
|
src/bepasty/views/download.py | 59.13% <32.50%> (-19.05%) |
:arrow_down: |
src/bepasty/storage/filesystem/__init__.py | 91.81% <66.66%> (-0.08%) |
:arrow_down: |
src/bepasty/utils/date_funcs.py | 93.33% <66.66%> (ø) |
|
... and 12 more |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 8f4c23f...ffc0c20. Read the comment docs.
"Here are the configuration defaults:" (note: singular configuration)
Also please edit conf.py and add add_module_names = False.
"Here are the configuration defaults:" (note: singular configuration)
Also please edit conf.py and add add_module_names = False.
My bad, I wasn't paying attention to the plural forms. I just made the requested modifications.
OK, looks good now! Thanks.
Assigned this to release 2.0.0 milestone because it is a breaking change and people need to edit their configs to keep it working.
So guess I'll make a 1.1.0 release first as soon as that milestone is completed, then merge this PR and then later release it as 2.0.0 (maybe together with more [breaking?] changes).
OK, looks good now! Thanks.
Assigned this to release 2.0.0 milestone because it is a breaking change and people need to edit their configs to keep it working.
So guess I'll make a 1.1.0 release first as soon as that milestone is completed, then merge this PR and then later release it as 2.0.0 (maybe together with more [breaking?] changes).
:) thanks for your patience and opinions during the review process.
@augustfengd Hmm, why did you delete this?
Hey @ThomasWaldmann! I was cleaning up some inactive repositories that I owned. It must've closed this pull request.
See #323.