-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from ByteOtter/add-application-settings
Add parsing of settings parameters
- Loading branch information
Showing
43 changed files
with
1,379 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Execute tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.x | ||
|
||
- name: Install dependencies | ||
run: pip install .[tests_require] | ||
|
||
- name: Run tests | ||
run: pytest -v --cov=src/ tests/ | ||
- name: Generate coverage report | ||
run: coverage xml | ||
|
||
# https://github.com/codacy/codacy-coverage-reporter-action | ||
- name: Run codacy-coverage-reporter | ||
uses: codacy/codacy-coverage-reporter-action@v1 | ||
continue-on-error: true | ||
with: | ||
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} | ||
coverage-reports: coverage.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Add parsing of application settings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.wy-nav-content { | ||
max-width: 90% !important; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
cobbler\_tftp.exceptions package | ||
================================ | ||
|
||
Submodules | ||
---------- | ||
|
||
cobbler\_tftp.exceptions.settings\_exceptions module | ||
---------------------------------------------------- | ||
|
||
.. automodule:: cobbler_tftp.exceptions.settings_exceptions | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
Module contents | ||
--------------- | ||
|
||
.. automodule:: cobbler_tftp.exceptions | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
cobbler\_tftp.settings.data package | ||
=================================== | ||
|
||
Module contents | ||
--------------- | ||
|
||
.. automodule:: cobbler_tftp.settings.data | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
cobbler\_tftp.settings.migrations package | ||
========================================= | ||
|
||
Submodules | ||
---------- | ||
|
||
cobbler\_tftp.settings.migrations.v1\_0 module | ||
---------------------------------------------- | ||
|
||
.. automodule:: cobbler_tftp.settings.migrations.v1_0 | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
Module contents | ||
--------------- | ||
|
||
.. automodule:: cobbler_tftp.settings.migrations | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
cobbler\_tftp.settings package | ||
============================== | ||
|
||
Subpackages | ||
----------- | ||
|
||
.. toctree:: | ||
:maxdepth: 4 | ||
|
||
cobbler_tftp.settings.data | ||
cobbler_tftp.settings.migrations | ||
|
||
Module contents | ||
--------------- | ||
|
||
.. automodule:: cobbler_tftp.settings | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
cobbler\_tftp.types package | ||
=========================== | ||
|
||
Module contents | ||
--------------- | ||
|
||
.. automodule:: cobbler_tftp.types | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
src | ||
=== | ||
cobbler_tftp | ||
============ | ||
|
||
.. toctree:: | ||
:maxdepth: 4 | ||
|
||
cobbler_tftp | ||
main | ||
service |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,3 +24,4 @@ | |
|
||
html_theme = "sphinx_rtd_theme" | ||
html_static_path = ["_static"] | ||
html_css_files = ["extend_width.css"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1 @@ | ||
""" | ||
Cobbler-TFTP provides a stateless TFTP-Server to provide an alternative method of operations | ||
for cobbler-sync. | ||
""" | ||
"""Cobbler-TFTP provides a stateless TFTP-Server as an alternative method of operations for ``cobbler sync``.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
"""Custom exceptions for cobbler-tftp.""" | ||
|
||
|
||
class CobblerTftpException(Exception): | ||
"""Generic cobbler-tftp exception.""" | ||
|
||
def __init__(self, message: str = "CobblerTFTPException"): | ||
"""Create custom generic CobblerTFTPException.""" | ||
super().__init__(message) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
"""Custom exceptions for cobbler-tftp's settings module.""" | ||
|
||
|
||
class CobblerTftpSettingsException(Exception): | ||
"""Generic cobbler-tftp exception.""" | ||
|
||
def __init__(self, message: str = "An Error occured!"): | ||
"""Create custom generic settings exception.""" | ||
super().__init__(message) | ||
|
||
|
||
class CobblerTftpMissingConfigParameterException(KeyError): | ||
"""Exception to handle a missing but required config parameter.""" | ||
|
||
def __init__( | ||
self, | ||
message="MissingConfigParameterException: Application settings missing required parameter!", | ||
parameter: str = "NONE", | ||
): | ||
"""Create custom exception to raise when a specific config parameter is missing for the application settings.""" | ||
if parameter is None or parameter == "NONE": | ||
raise ValueError("Parameter cannot be 'NONE'") | ||
self.parameter = parameter | ||
self.message = str.join(message, parameter) | ||
super().__init__(message, parameter) |
Oops, something went wrong.