add controller options to allow multiple routes per controller

This commit is contained in:
Jakob Ketterl
2020-02-23 18:32:37 +01:00
parent 42191f4e77
commit aa9737498a
8 changed files with 24 additions and 25 deletions

View File

@ -8,7 +8,7 @@ import json
class StatusController(Controller):
def handle_request(self):
def indexAction(self):
pm = PropertyManager.getSharedInstance()
# TODO keys that have been left out since they are no longer simple strings: sdr_hw, bands, antenna
vars = {
@ -25,8 +25,6 @@ class StatusController(Controller):
}
self.send_response("\n".join(["{key}={value}".format(key=key, value=value) for key, value in vars.items()]))
class StatusJsonController(Controller):
def getProfileStats(self, profile):
return {
"name": profile["name"],
@ -43,7 +41,7 @@ class StatusJsonController(Controller):
}
return stats
def handle_request(self):
def jsonAction(self):
pm = PropertyManager.getSharedInstance()
gps = pm["receiver_gps"]