2020-02-23 16:22:13 +00:00
|
|
|
from . import Controller
|
|
|
|
from owrx.feature import FeatureDetector
|
2020-05-10 15:12:42 +00:00
|
|
|
from owrx.config import Config
|
2020-02-23 16:22:13 +00:00
|
|
|
import json
|
|
|
|
|
|
|
|
|
|
|
|
class ApiController(Controller):
|
2020-02-23 17:32:37 +00:00
|
|
|
def indexAction(self):
|
2020-02-23 16:22:13 +00:00
|
|
|
data = json.dumps(FeatureDetector().feature_report())
|
|
|
|
self.send_response(data, content_type="application/json")
|
2020-05-10 15:12:42 +00:00
|
|
|
|
|
|
|
def receiverDetails(self):
|
|
|
|
receiver_details = Config.get().filter(
|
|
|
|
"receiver_name",
|
|
|
|
"receiver_location",
|
|
|
|
"receiver_asl",
|
|
|
|
"receiver_gps",
|
|
|
|
"photo_title",
|
|
|
|
"photo_desc",
|
|
|
|
)
|
|
|
|
data = json.dumps(receiver_details.__dict__())
|
|
|
|
self.send_response(data, content_type="application/json")
|