Utils package¶
Utils.app_args module¶
The app_args module: Command line args.
Provides functionality to determine what configuration the application has been run with via command line arguments.
Utils.app_logging module¶
The Utils.app_logging module: Application logging.
Provides functionality to support logging throughout the application runtime.
Utils.bootstrap_admin module¶
The bootstrap_admin module: Admin user construction.
Provides functionality to create an admin user for the application.
- Src.Utils.bootstrap_admin.bootstrap_admin(app, force_bootstrap)[source]¶
The admin user setup function, used to gain user input of the desired admin credentials of the applications admin user.
- Parameters:
app (Flask application) – The Flask application to provide context
force_bootstrap (Boolean) – A Boolean flag used to force new admin creation
Utils.constants module¶
The constants module: Application constants.
Provides global constants to be used throughout the application.
Utils.http module¶
The http module: HTTP request utilities.
Provides functionality to process the received responses from HTTP requests sent by the application in order to integrate with the NCTS Server.
- Src.Utils.http.response_to_csv(http_response, file_name)[source]¶
Retrieves and downloads the given CSV file from a HTTP request response
- Parameters:
http_response (Response) – The response object to retrieve the CSV file from
file_name (str) – The file name to save the CSV file as
- Src.Utils.http.xml_response_to_version(http_response)[source]¶
Converts the NCTS API available distribution response in to a easily passable dictionary consisting of only the available AMT distributions.
- Parameters:
http_response (Response) – The response object to retrieve the CSV file from
- Returns:
A dictionary representation of all available AMT distribution
- Return type:
dict
Utils.lib module¶
The lib module: Random Utility functions.
- Src.Utils.lib.is_outdated_versions(current_version_date, latest_version_date)[source]¶
Checks if the current AMT distribution date matches the latest available AMT distribution date.
- Parameters:
current_version_date (Date) – The date of the applications current AMT distribution version
latest_version_date (Date) – The date of the NCTS API latest AMT distribution version
- Returns:
Boolean representation of whether the applications current version date is not the latest NCTS version
- Return type:
Boolean
Utils.startup_tasks module¶
The startup_tasks module: Application startup tasks.
Provides the application with tasks intended to be run on application startup.