-
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API Refactoring #20
Merged
+1,319
−1,054
Merged
API Refactoring #20
Changes from 18 commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
b7e48ff
implements pyproject toml and change test filesystem
GabrielBarberini 9eac5dc
enhances error log parsing
GabrielBarberini 7798064
refactors controllers/flight
GabrielBarberini d252369
adjusts controllers.environment method signatures
GabrielBarberini c6198e0
sanitizes controllers.flight dependencies
GabrielBarberini 1c26784
initiates controllers.motor refactoring
GabrielBarberini 72b3321
refactors controllers.rocket
GabrielBarberini e9e392f
adapts rocket repository to comply with rocket controller
GabrielBarberini 169a8c7
adapts rocket routes to comply with refactored rocket controller
GabrielBarberini c02b505
refactors repositories
GabrielBarberini 873f96e
removes forward reference and improves logs wording
GabrielBarberini f2a89a9
refactors motor controller nad adapts adjacent controllers accordingly
GabrielBarberini 1008c5a
renames engine files
GabrielBarberini e516fd6
refactors models
GabrielBarberini ff4859f
refactors repositories
GabrielBarberini ae9dbd2
refactors routes
GabrielBarberini 803f0db
general refactoring
GabrielBarberini 7f50464
addresses review comments
GabrielBarberini 7879742
fixes missing importing
GabrielBarberini 77efcc2
implements db context manager
GabrielBarberini dc40720
addresses review comments
GabrielBarberini 288ad39
Update lib/repositories/rocket.py
GabrielBarberini 7d615c7
updates repositories init
GabrielBarberini fc730e6
implements async context manager and threading lock
GabrielBarberini 05aa6fd
fixes async issues
GabrielBarberini ff510c8
minor bug fixing
GabrielBarberini 95a99fc
addresses pylint complains
GabrielBarberini fea731f
removes redundant event set and ensures thread lock on finalization
GabrielBarberini 5b5fa81
removes useless collection setter
GabrielBarberini 9ac550b
implements stdout log handler
GabrielBarberini File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,18 @@ | ||
# lib/__init__.py | ||
import logging | ||
from .api import app | ||
|
||
logging.basicConfig( | ||
level=logging.INFO, | ||
filename='app.log', | ||
filemode='a', | ||
format='%(asctime)s - %(levelname)s - %(message)s', | ||
) | ||
|
||
|
||
def parse_error(error): | ||
exc_type = type(error).__name__ | ||
exc_obj = f"{error}".replace("\n", " ").replace(" ", " ") | ||
return f"{exc_type} exception: {exc_obj}" | ||
|
||
|
||
from .api import app # noqa | ||
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,6 +1 @@ | ||
# lib/controllers/__init__.py | ||
|
||
|
||
def parse_error(e): | ||
exc_str = f"{e}".replace("\n", " ").replace(" ", " ") | ||
return exc_str |
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the reason for brining this line to the bottom of the file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid circular imports. I use parse_error on
api.py
as well, and since importing app from it means the importing system will run over the whole file, it ended up breaking as parse_error was not ready yet.