-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement sorting of events via config file (#81)
* Raw sorting implementation Bad code and not all sorting results are equivalent to sorting results in nowadays Zino TK * Finish sorting implementation All sorting methods are implemented and work as intended * Add sort_by to config Sorting method is configured as sort_by (str) under [howitz] section. * Save configured sorting method in session * Add basic documentation about implemented sorting methods * Remove unecessary underscores double underscore in _value_ holds some meaning for Enum, but the other ones seem unecessary * Add sorting tests * Move config consts to a separate file In order to avoid circular imports * Stop implicit None return when sorting * Fix docs * Rename enum * Fix errors in tests * Run tests with app context Otherwise, the logger.debug statement in sorted_events() fails with RuntimeError * Document get_priority function * Add reports folder to gitignore Contains xml files with coverage reports and results * Add tests for get_priority helper * Specify param type in get_priority * Use event's own method for determining whether it is down * Simplify get_priority helper * Add more tests for sort_events helper * Bump zinolib to 1.2.0 * Add flask-caching dependency * Configure SimpleCache for the app * Use flask cache to re-sort event list if there are relevant ntie changes * Rename sort_by default method to raw in config * Polish if statements * Split elifs from sort_events() into separate functions * Make caching configurable * Move cache config to flask section --------- Co-authored-by: Simon Oliver Tveit <[email protected]>
- Loading branch information
1 parent
3ac00e7
commit 311a477
Showing
11 changed files
with
556 additions
and
27 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
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
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,3 @@ | ||
|
||
DEFAULT_STORAGE = "./howitz.sqlite3" | ||
DEFAULT_TIMEZONE = 'UTC' |
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.