def _dump_config(self, _request): _config = _get_config() _config["ios"] = { "configed": True } _dump_config(_config) return
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
def _dump_mqtt_config(self, _request): _config = _get_config() _config["android"] = { "type": "MQTT" } _dump_config(_config) return _return(self, 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)
def _dump_config(self): _config = _get_config() _config["config_status"] = CONFIG_STATUS.IOS _config["ios"] = { "configed": True } _dump_config(_config) return
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
def _dump_server_config(self, _server_config): """ server config is first """ _config = { "config_status": CONFIG_STATUS.SERVER, "server": _server_config } _dump_config(_config) return
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
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)
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)
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)
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)
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
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
def _dump_db_config(self, _db_config): _config = { "db": _db_config } _dump_config(_config) return
def _dump_db_config(self, _db_config): _config = _get_config() _config["config_status"] = CONFIG_STATUS.DATABASE _config["db"] = _db_config _dump_config(_config) return
def _dump_restart_config(self): _config = _get_config() _config["config_status"] = CONFIG_STATUS.RESTART _dump_config(_config) return