예제 #1
0
 def _dump_config(self, _request):
     _config = _get_config()
     _config["ios"] = {
         "configed": True
     }
     _dump_config(_config)
     return
예제 #2
0
    def _dump_server_config(self, _server_config):
        """
        server config is first
        """

        _url = _server_config.get("url")

        _server_config.update({"ssl":"off"})
        if _url.startswith("https"):
            _server_config.update({"ssl":"on"})

        _host = _url[_url.index("//")+2:]
        _host = _host.split(":")

        if len(_host) == 1:
            _server_config.update({"name": _host[0]})
            if _servcer_config.get("ssl") == "on":
                _server_config.update({"port": 443})
            else:
                _server_config.update({"port": 80})
                
        if len(_host) == 2:
            _server_config.update({"name": _host[0], "port": int(_host[1])})
        
        _config = {
            "config_status": CONFIG_STATUS.SERVER,
            "server": _server_config
        }
        _dump_config(_config)
        return
예제 #3
0
 def _dump_mqtt_config(self, _request):
     _config = _get_config()
     _config["android"] = {
         "type": "MQTT"
     }
     _dump_config(_config)
     return _return(self, 0)
예제 #4
0
    def _dump_server_config(self, _server_config):
        """
        server config is first
        """

        _url = _server_config.get("url")
        _server_config.update({"ssl":"off"})
        if _url.startswith("https"):
            _server_config.update({"ssl":"on"})

        _host = _url[_url.index("//")+2:]
        _host = _host.split(":")

        if len(_host) == 1:
            _server_config.update({"name": _host[0]})
            if _servcer_config.get("ssl") == "on":
                _server_config.update({"port": 443})
            else:
                _server_config.update({"port": 80})
                
        if len(_host) == 2:
            _server_config.update({"name": _host[0], "port": int(_host[1])})
        
        _config = {
            "config_status": CONFIG_STATUS.SERVER,
            "server": _server_config
        }
        _dump_config(_config)
        return
예제 #5
0
 def _dump_mqtt_config(self, _request):
     _config = _get_config()
     _config["config_status"] = CONFIG_STATUS.ANDROID
     _config["android"] = {
         "type": "MQTT"
     }
     _dump_config(_config)
     return _return(self, 0)
예제 #6
0
 def _dump_config(self):
     _config = _get_config()
     _config["config_status"] = CONFIG_STATUS.IOS
     _config["ios"] = {
         "configed": True
     }
     _dump_config(_config)
     return
예제 #7
0
 def _dump_mqtt_config(self, _request):
     _config = _get_config()
     _config["config_status"] = CONFIG_STATUS.ANDROID
     _config["android"] = {
         "type": "MQTT"
     }
     _dump_config(_config)
     return _return(self, 0)
예제 #8
0
 def _dump_config(self):
     _config = _get_config()
     _config["config_status"] = CONFIG_STATUS.IOS
     _config["ios"] = {
         "configed": True
     }
     _dump_config(_config)
     return
예제 #9
0
 def _dump_config(self, _request):
     _config = _get_config()
     _config["api"] = self._api
     _config["team"] = {
         "app_uuid": self._app_uuid
     }
     _config["configed"] = True
     _dump_config(_config)
     return True
예제 #10
0
 def _dump_server_config(self, _server_config):
     """
     server config is first
     """
     _config = {
         "config_status": CONFIG_STATUS.SERVER,
         "server": _server_config
     }
     _dump_config(_config)
     return
예제 #11
0
 def _dump_config(self, _request):
     _config = _get_config()
     _config["config_status"] = CONFIG_STATUS.FIRST
     _config["api"] = self._api
     _config["team"] = {
         "app_uuid": self._app_uuid
     }
     _config["configed"] = True
     _dump_config(_config)
     return True
예제 #12
0
 def _dump_config(self, _request):
     _config = _get_config()
     _config["config_status"] = CONFIG_STATUS.FIRST
     _config["api"] = self._api
     _config["team"] = {
         "app_uuid": self._app_uuid
     }
     _config["configed"] = True
     _dump_config(_config)
     return True
예제 #13
0
 def _dump_gcm_config(self, _request):
     _config = _get_config()
     _config["android"] = {
         "type": "GCM",
         "gcm": {
             api_key: _request.get("api_key")
         }
     }
     _dump_config(_config)
     return _return(self, 0)
예제 #14
0
 def _dump_jpush_config(self, _request):
     _config = _get_config()
     _config["android"] = {
         "type": "JPUSH",
         "jpush": {
             api_key: _request.get("master_secret")
         }
     }
     _dump_config(_config)
     return _return(self, 0)
예제 #15
0
 def _dump_server_config(self, _server_config):
     """
     server config is first
     """
     _config = {
         "config_status": CONFIG_STATUS.SERVER,
         "server": _server_config
     }
     _dump_config(_config)
     return
예제 #16
0
 def _dump_gcm_config(self, _request):
     _config = _get_config()
     _config["config_status"] = CONFIG_STATUS.ANDROID
     _config["android"] = {
         "type": "GCM",
         "gcm": {
             api_key: _request.get("api_key")
         }
     }
     _dump_config(_config)
     return _return(self, 0)
예제 #17
0
 def _dump_jpush_config(self, _request):
     _config = _get_config()
     _config["config_status"] = CONFIG_STATUS.ANDROID
     _config["android"] = {
         "type": "JPUSH",
         "jpush": {
             api_key: _request.get("master_secret")
         }
     }
     _dump_config(_config)
     return _return(self, 0)
예제 #18
0
 def _dump_gcm_config(self, _request):
     _config = _get_config()
     _config["config_status"] = CONFIG_STATUS.ANDROID
     _config["android"] = {
         "type": "GCM",
         "gcm": {
             api_key: _request.get("api_key")
         }
     }
     _dump_config(_config)
     return _return(self, 0)
예제 #19
0
 def _dump_jpush_config(self, _request):
     _config = _get_config()
     _config["config_status"] = CONFIG_STATUS.ANDROID
     _config["android"] = {
         "type": "JPUSH",
         "jpush": {
             api_key: _request.get("master_secret")
         }
     }
     _dump_config(_config)
     return _return(self, 0)
예제 #20
0
 def _dump_config(self, _request):
     _config = _get_config()
     _config["config_status"] = CONFIG_STATUS.FIRST
     _config["api"] = self._api
     _config["team"] = {
         "app_uuid": self._app_uuid,
         "name": "Test PPMessage Lite Server"
     }
     _config["user"] = {
         "user_uuid": self._user_uuid,
         "user_email": _request.get("user_email"),
         "user_fullname": _request.get("user_fullname"),
         "user_password": _request.get("user_password")
     }
     _config["configed"] = True
     _dump_config(_config)
     return True
예제 #21
0
 def _dump_config(self, _request):
     _config = _get_config()
     _config["config_status"] = CONFIG_STATUS.FIRST
     _config["api"] = self._api
     _config["team"] = {
         "app_uuid": self._app_uuid,
         "name": _request.get("team_name")
     }
     _config["user"] = {
         "user_uuid": self._user_uuid,
         "user_email": _request.get("user_email"),
         "user_fullname": _request.get("user_fullname"),
         "user_password": _request.get("user_password")
     }
     _config["configed"] = True
     _dump_config(_config)
     return True
예제 #22
0
 def _dump_db_config(self, _db_config):
     _config = {
         "db": _db_config
     }
     _dump_config(_config)
     return
예제 #23
0
 def _dump_db_config(self, _db_config):
     _config = _get_config()
     _config["config_status"] = CONFIG_STATUS.DATABASE
     _config["db"] = _db_config
     _dump_config(_config)
     return
예제 #24
0
 def _dump_restart_config(self):
     _config = _get_config()
     _config["config_status"] = CONFIG_STATUS.RESTART
     _dump_config(_config)
     return
예제 #25
0
 def _dump_db_config(self, _db_config):
     _config = _get_config()
     _config["config_status"] = CONFIG_STATUS.DATABASE
     _config["db"] = _db_config
     _dump_config(_config)
     return
예제 #26
0
 def _dump_restart_config(self):
     _config = _get_config()
     _config["config_status"] = CONFIG_STATUS.RESTART
     _dump_config(_config)
     return