當前位置: 首頁>>代碼示例>>Python>>正文


Python DeviceInfo.async_update方法代碼示例

本文整理匯總了Python中ppmessage.db.models.DeviceInfo.async_update方法的典型用法代碼示例。如果您正苦於以下問題:Python DeviceInfo.async_update方法的具體用法?Python DeviceInfo.async_update怎麽用?Python DeviceInfo.async_update使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ppmessage.db.models.DeviceInfo的用法示例。


在下文中一共展示了DeviceInfo.async_update方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: _update_device_with_is_development

# 需要導入模塊: from ppmessage.db.models import DeviceInfo [as 別名]
# 或者: from ppmessage.db.models.DeviceInfo import async_update [as 別名]
 def _update_device_with_is_development(self, _device_uuid, _is_development):
     _values = {
         "uuid": _device_uuid,
         "is_development": _is_development,
     }
     _row = DeviceInfo(**_values)
     _row.update_redis_keys(self.application.redis)
     _row.async_update()
     return
開發者ID:1733604733,項目名稱:ppmessage,代碼行數:11,代碼來源:ppkefuloginhandler.py

示例2: _update_device_online

# 需要導入模塊: from ppmessage.db.models import DeviceInfo [as 別名]
# 或者: from ppmessage.db.models.DeviceInfo import async_update [as 別名]
 def _update_device_online(self):
     _values = {
         "uuid": self.device.get("uuid"),
         "device_is_online": True
     }
     _row = DeviceInfo(**_values)
     _row.update_redis_keys(self.application.redis)
     _row.async_update()
     return
開發者ID:1733604733,項目名稱:ppmessage,代碼行數:11,代碼來源:ppkefuloginhandler.py

示例3: _update_device_with_user

# 需要導入模塊: from ppmessage.db.models import DeviceInfo [as 別名]
# 或者: from ppmessage.db.models.DeviceInfo import async_update [as 別名]
 def _update_device_with_user(self, _device_uuid, _user_uuid):
     _values = {
         "uuid": _device_uuid,
         "user_uuid": _user_uuid,
     }
     _row = DeviceInfo(**_values)
     _row.update_redis_keys(self.application.redis)
     _row.async_update()
     return
開發者ID:1733604733,項目名稱:ppmessage,代碼行數:11,代碼來源:ppkefuloginhandler.py

示例4: _update_device

# 需要導入模塊: from ppmessage.db.models import DeviceInfo [as 別名]
# 或者: from ppmessage.db.models.DeviceInfo import async_update [as 別名]
 def _update_device(self):        
     _values = {
         "uuid": self.device_uuid,
         "device_is_online": False
     }        
     _row = DeviceInfo(**_values)
     _row.update_redis_keys(self.application.redis)
     _row.async_update(self.application.redis)
     return
開發者ID:codelulu,項目名稱:ppmessage,代碼行數:11,代碼來源:ppkefulogouthandler.py

示例5: _post

# 需要導入模塊: from ppmessage.db.models import DeviceInfo [as 別名]
# 或者: from ppmessage.db.models.DeviceInfo import async_update [as 別名]
    def _post(self, _request):
        _device_uuid = _request.get("device_uuid")

        if _device_uuid == None:
            self.setErrorCode(API_ERR.ERR_PARAM)
            return

        _redis = self.application.redis
        _device = redis_hash_to_dict(_redis, DeviceInfo, _device_uuid)

        if _device is None:
            logging.error("Error NO DEVICE for key [%s] ." % (_key))
            self.setErrorCode(API_ERR.NO_DEVICE)
            return

        _values = {
            "uuid": _device_uuid
        }
        
        if "fullname" in _request:
            _values["device_fullname"]= _request["fullname"]

        if "ostype" in _request:
            _values["device_ostype"] = _request["ostype"].upper()
                
        if "osversion" in _request:
            _values["device_osversion"] = _request["osversion"]

        # apilevel for android
        if "apilevel" in _request:
            _values["device_android_apilevel"] = _request["apilevel"]
            
        # phone number for phone
        if "phone" in _request:
            _values["device_phonenumber"] = _request["phone"]

        if "iosmodel" in _request:
            _values["device_ios_model"] = _request["iosmodel"]

        if "iostoken" in _request:
            _values["device_ios_token"] = _request["iostoken"]
            self.application.redis.srem(INVALID_IOS_TOKEN, _request["iostoken"])

        if "device_android_gcmtoken" in _request:
            _values["device_android_gcmtoken"] = _request["device_android_gcmtoken"]

        if "device_android_gcmpush" in _request:
            _values["device_android_gcmpush"] = _request["device_android_gcmpush"]

        _row = DeviceInfo(**_values)
        _row.update_redis_keys(_redis)
        _row.async_update()        
        return
開發者ID:1733604733,項目名稱:ppmessage,代碼行數:55,代碼來源:setdeviceinfohandler.py

示例6: _update_device

# 需要導入模塊: from ppmessage.db.models import DeviceInfo [as 別名]
# 或者: from ppmessage.db.models.DeviceInfo import async_update [as 別名]
    def _update_device(self):
        _values = {
            "uuid": self.device_uuid,
            "device_is_online": False
        }        
        _row = DeviceInfo(**_values)
        _row.update_redis_keys(self.application.redis)
        _row.async_update()

        _d = redis_hash_to_dict(self.application.redis, DeviceInfo, self.device_uuid)
        logging.info(_d)
        return
開發者ID:caomike,項目名稱:ppmessage,代碼行數:14,代碼來源:ppkefulogouthandler.py

示例7: _update_device_with_token

# 需要導入模塊: from ppmessage.db.models import DeviceInfo [as 別名]
# 或者: from ppmessage.db.models.DeviceInfo import async_update [as 別名]
 def _update_device_with_token(self, _device_uuid):
     _device_android_jpush_registrationid = self.input_data.get("device_android_jpush_registrationid")
     _device_android_gcmtoken = self.input_data.get("device_android_gcmtoken")
     _device_ios_token = self.input_data.get("device_ios_token")
     _values = {
         "uuid": _device_uuid,
         "device_ios_token": _ios_token,
         "device_android_gcmtoken": _device_android_gcmtoken,
         "device_android_jpush_registrationid": _device_android_jpush_registrationid
     }
     _row = DeviceInfo(**_values)
     _row.update_redis_keys(self.application.redis)
     _row.async_update(self.application.redis)
     return
開發者ID:Bossuo,項目名稱:ppmessage,代碼行數:16,代碼來源:ppkefuloginhandler.py

示例8: _update_device_with_token

# 需要導入模塊: from ppmessage.db.models import DeviceInfo [as 別名]
# 或者: from ppmessage.db.models.DeviceInfo import async_update [as 別名]
    def _update_device_with_token(self, _device_uuid, _token):
        _ios_token = None
        _gcm_token = None
        _gcm_push = False
        if self._ostype == OS.IOS:
            _ios_token = _token
        if self._ostype == OS.AND:
            _gcm_token = _token
        if _gcm_token != None:
            _gcm_push = True

        _values = {
            "uuid": _device_uuid,
            "device_ios_token": _ios_token,
            "device_android_gcmtoken": _gcm_token,
            "device_android_gcmpush": _gcm_push,
        }
        _row = DeviceInfo(**_values)
        _row.update_redis_keys(self.application.redis)
        _row.async_update()
        return
開發者ID:1733604733,項目名稱:ppmessage,代碼行數:23,代碼來源:ppkefuloginhandler.py

示例9: _online

# 需要導入模塊: from ppmessage.db.models import DeviceInfo [as 別名]
# 或者: from ppmessage.db.models.DeviceInfo import async_update [as 別名]
    def _online(self, _user_uuid, _device_uuid, _app_uuid):
        _redis = self.application.redis
        _user = redis_hash_to_dict(_redis, DeviceUser, _user_uuid)
        if _user == None:
            self.setErrorCode(API_ERR.NO_USER)
            return
        
        if _user["ppcom_mobile_device_uuid"] != _device_uuid \
           and _user["ppcom_browser_device_uuid"] != _device_uuid:
            self.setErrorCode(API_ERR.NO_DEVICE)
            return

        _device = redis_hash_to_dict(_redis, DeviceInfo, _device_uuid)
        if _device == None:
            self.setErrorCode(API_ERR.NO_DEVICE)
            return

        _row = DeviceInfo(uuid=_device_uuid, device_is_online=True)
        _row.async_update()
        _row.update_redis_keys(self.application.redis)

        self._user_online_status(_user_uuid, _device_uuid, _app_uuid)
        return
開發者ID:caomike,項目名稱:ppmessage,代碼行數:25,代碼來源:pponlinehandler.py

示例10: _offline_device

# 需要導入模塊: from ppmessage.db.models import DeviceInfo [as 別名]
# 或者: from ppmessage.db.models.DeviceInfo import async_update [as 別名]
 def _offline_device(self, _device_uuid):
     _row = DeviceInfo(**{"uuid": _device_uuid, "device_is_online": False})
     _row.async_update()
     _row.update_redis_keys(self.application.redis)
     return
開發者ID:1733604733,項目名稱:ppmessage,代碼行數:7,代碼來源:ppkefuloginhandler.py

示例11: device_online

# 需要導入模塊: from ppmessage.db.models import DeviceInfo [as 別名]
# 或者: from ppmessage.db.models.DeviceInfo import async_update [as 別名]
 def device_online(self, _device_uuid, _is_online=True):
     _row = DeviceInfo(uuid=_device_uuid, device_is_online=_is_online)
     _row.async_update(self.redis)
     _row.update_redis_keys(self.redis)
     return
開發者ID:Michael-Z,項目名稱:ppmessage,代碼行數:7,代碼來源:pcsocketapp.py

示例12: _ppcom_offline

# 需要導入模塊: from ppmessage.db.models import DeviceInfo [as 別名]
# 或者: from ppmessage.db.models.DeviceInfo import async_update [as 別名]
 def _ppcom_offline(self, _device_uuid):
     _row = DeviceInfo(uuid=_device_uuid, device_is_online=False)
     _row.async_update()
     _row.update_redis_keys(self.redis)
     # FIXME: UserOnlineStatusLog
     return
開發者ID:caomike,項目名稱:ppmessage,代碼行數:8,代碼來源:monitorapp.py


注:本文中的ppmessage.db.models.DeviceInfo.async_update方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。