This PR fixes #253 by correctly telling pbr to copy over the templates and static folders which contain the HTML and JavaScript used by SimpleUI. To do this I was required to move the folders out of the Applications folder and edit some of the import Flask code to look in the correct directory faraday/templates and faraday/static thanks to case 2 in the Flask templates documentation.
I also fixed the uncaught exceptions when no configuration file was found or a configuration file had not been changed from "REPLACEME". This includes checking for "REPLACEME" and raising an exception as well as catching the ValueError that occurs when "REPLACEME" is converted with int(). When these exceptions are caught Flask returns '' empty data. If all try statements succeed and else statement returns the template since we know the configuration data was likely correct.
Main changes include:
Moved static and template folders
Catch and correctly react to no configuration file being found
Raise exception when "REPLACEME" is found in callsign configuration value
Catch exceptions for "REPLACEME" being present in callsign and int configuration fields.
Return no data '' when exceptions occur to appease Flask which must return something.
This PR fixes #253 by correctly telling
pbr
to copy over thetemplates
andstatic
folders which contain the HTML and JavaScript used by SimpleUI. To do this I was required to move the folders out of the Applications folder and edit some of the import Flask code to look in the correct directoryfaraday/templates
andfaraday/static
thanks to case 2 in the Flask templates documentation.I also fixed the uncaught exceptions when no configuration file was found or a configuration file had not been changed from "REPLACEME". This includes checking for "REPLACEME" and raising an exception as well as catching the ValueError that occurs when "REPLACEME" is converted with
int()
. When these exceptions are caught Flask returns '' empty data. If all try statements succeed and else statement returns the template since we know the configuration data was likely correct.Main changes include:
static
andtemplate
folders