コード例 #1
0
ファイル: __init__.py プロジェクト: zipper177/openwebrx
 def start():
     if not Config.get()["services_enabled"]:
         return
     for source in SdrService.getSources().values():
         props = source.getProps()
         if "services" not in props or props["services"] is not False:
             Services.handlers.append(ServiceHandler(source))
コード例 #2
0
 def __sendProfiles(self):
     profiles = [
         {"name": s.getName() + " " + p["name"], "id": sid + "|" + pid}
         for (sid, s) in SdrService.getSources().items()
         for (pid, p) in s.getProfiles().items()
     ]
     self.write_profiles(profiles)
コード例 #3
0
 def start():
     if not PropertyManager.getSharedInstance()["services_enabled"]:
         return
     for source in SdrService.getSources().values():
         props = source.getProps()
         if "services" not in props or props["services"] is not False:
             Services.handlers.append(ServiceHandler(source))
コード例 #4
0
 def indexAction(self):
     pm = Config.get()
     status = {
         "receiver": {
             "name": pm["receiver_name"],
             "admin": pm["receiver_admin"],
             "gps": pm["receiver_gps"],
             "asl": pm["receiver_asl"],
             "location": pm["receiver_location"],
         },
         "max_clients": pm["max_clients"],
         "version": openwebrx_version,
         "sdrs": [self.getReceiverStats(r) for r in SdrService.getSources().values()]
     }
     self.send_response(json.dumps(status), content_type="application/json")
コード例 #5
0
ファイル: status.py プロジェクト: jwt27/openwebrx
 def indexAction(self):
     pm = Config.get()
     headers = None
     if "Authorization" in self.request.headers:
         try:
             headers = ReceiverId.getResponseHeader(self.request.headers["Authorization"])
         except KeyException:
             logger.exception("error processing authorization header")
     status = {
         "receiver": {
             "name": pm["receiver_name"],
             "admin": pm["receiver_admin"],
             "gps": pm["receiver_gps"],
             "asl": pm["receiver_asl"],
             "location": pm["receiver_location"],
         },
         "max_clients": pm["max_clients"],
         "version": openwebrx_version,
         "sdrs": [self.getReceiverStats(r) for r in SdrService.getSources().values()]
     }
     self.send_response(json.dumps(status), content_type="application/json", headers=headers)