Merge pull request #1 from D0han/black_reformat
Use official python formatter for better code readability
This commit is contained in:
19
openwebrx.py
19
openwebrx.py
@ -3,13 +3,14 @@
|
||||
from http.server import HTTPServer
|
||||
from owrx.http import RequestHandler
|
||||
from owrx.config import PropertyManager
|
||||
from owrx.feature import FeatureDetector
|
||||
from owrx.feature import FeatureDetector
|
||||
from owrx.source import SdrService, ClientRegistry
|
||||
from socketserver import ThreadingMixIn
|
||||
from owrx.sdrhu import SdrHuUpdater
|
||||
|
||||
import logging
|
||||
logging.basicConfig(level = logging.DEBUG, format = "%(asctime)s - %(name)s - %(levelname)s - %(message)s")
|
||||
|
||||
logging.basicConfig(level=logging.DEBUG, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s")
|
||||
|
||||
|
||||
class ThreadedHttpServer(ThreadingMixIn, HTTPServer):
|
||||
@ -17,21 +18,25 @@ class ThreadedHttpServer(ThreadingMixIn, HTTPServer):
|
||||
|
||||
|
||||
def main():
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
|
||||
OpenWebRX - Open Source SDR Web App for Everyone! | for license see LICENSE file in the package
|
||||
_________________________________________________________________________________________________
|
||||
|
||||
Author contact info: Andras Retzler, HA7ILM <randras@sdr.hu>
|
||||
|
||||
""")
|
||||
"""
|
||||
)
|
||||
|
||||
pm = PropertyManager.getSharedInstance().loadConfig("config_webrx")
|
||||
|
||||
featureDetector = FeatureDetector()
|
||||
if not featureDetector.is_available("core"):
|
||||
print("you are missing required dependencies to run openwebrx. "
|
||||
"please check that the following core requirements are installed:")
|
||||
print(
|
||||
"you are missing required dependencies to run openwebrx. "
|
||||
"please check that the following core requirements are installed:"
|
||||
)
|
||||
print(", ".join(featureDetector.get_requirements("core")))
|
||||
return
|
||||
|
||||
@ -42,7 +47,7 @@ Author contact info: Andras Retzler, HA7ILM <randras@sdr.hu>
|
||||
updater = SdrHuUpdater()
|
||||
updater.start()
|
||||
|
||||
server = ThreadedHttpServer(('0.0.0.0', pm.getPropertyValue("web_port")), RequestHandler)
|
||||
server = ThreadedHttpServer(("0.0.0.0", pm.getPropertyValue("web_port")), RequestHandler)
|
||||
server.serve_forever()
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user