FaradayRF / Faraday-Software

Faraday node software
https://www.faradayrf.com
Other
48 stars 19 forks source link

Issue 253: Fix SimpleUI When Installed Via pip & More #254

Closed kb1lqc closed 7 years ago

kb1lqc commented 7 years ago

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: