本文整理汇总了Python中org.cyy.fw.piedis.Response类的典型用法代码示例。如果您正苦于以下问题:Python Response类的具体用法?Python Response怎么用?Python Response使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Response类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: restore
def restore(self, key, serialValue, millTTL, replace):
if replace :
resp = self.sendCommand(Command.RESTORE, key, str(millTTL), serialValue, RedisKeyword.REPLACE)
return Response.toStr(resp)
else:
resp = self.sendCommand(Command.RESTORE, key, str(millTTL), serialValue)
return Response.toStr(resp)
示例2: scan
def scan(self, cursor, params):
args = (str(cursor),)
if params != None:
args = args + params.getParams()
resp = self.sendCommand(Command.SCAN, *args)
return Response.toScanResult(resp)
示例3: bitCount
def bitCount(self, key, start, end):
args = [key]
if start != None:
args.append(str(start))
if end != None:
args.append(str(end))
resp = self.sendCommand(Command.BITCOUNT, *tuple(args))
return Response.toInt(resp)
示例4: zUnionStore
def zUnionStore(self, destKey, params, key, *moreKeys):
args = (destKey,)
numberKeys = 1 + len(moreKeys)
args += (numberKeys, key)
args += moreKeys
if params != None:
args += params.getParams()
resp = self.sendCommand(Command.ZUNIONSTORE, *args)
return Response.toInt(resp)
示例5: sort
def sort(self, key, params, destKey):
args = []
args.append(key)
if params != None:
args += params.getParams()
if destKey != None:
args.append(RedisKeyword.STORE)
args.append(destKey)
resp = self.sendCommand(Command.SORT, *tuple(args))
return Response.toTuple(resp)
示例6: scriptExist
def scriptExist(self, script, *moreScripts):
resp = self.sendCommand(Command.SCRIPT, RedisKeyword.EXISTS, script, *moreScripts)
return Response.toTuple(resp)
示例7: objectEncoding
def objectEncoding(self, key):
resp = self.sendCommand(Command.OBJECT, RedisKeyword.ENCODING, key)
return Response.toStr(resp)
示例8: renameNX
def renameNX(self, key, newKey):
resp = self.sendCommand(Command.RENAMENX, key, newKey)
return Response.toInt(resp) == 1
示例9: zScan
def zScan(self, key, cursor, scanParams):
args = (key, cursor)
if scanParams != None:
args += scanParams.getParams()
resp = self.sendCommand(Command.ZSCAN, *args)
return Response.toScoreMemberScanResult(resp)
示例10: pExpireAt
def pExpireAt(self, key, millTs):
resp = self.sendCommand(Command.PEXPIREAT, key, str(millTs))
return Response.toInt(resp) == 1
示例11: randomKey
def randomKey(self):
resp = self.sendCommand(Command.RANDOMKEY)
return Response.toStr(resp)
示例12: quit
def quit(self):
resp = self.sendCommand(Command.QUIT)
return Response.toStr(resp)
示例13: persist
def persist(self, key):
resp = self.sendCommand(Command.PERSIST, key)
return Response.toInt(resp) == 1
示例14: echo
def echo(self, message):
resp = self.sendCommand(Command.ECHO, message)
return Response.toStr(resp)
示例15: ping
def ping(self):
resp = self.sendCommand(Command.PING)
return Response.toStr(resp)