forked from mirror/ledisdb
update py client
This commit is contained in:
parent
855682ff2b
commit
0f4c628146
|
@ -906,10 +906,14 @@ class Ledis(object):
|
||||||
return self.execute_command("BSCAN", key, match, count)
|
return self.execute_command("BSCAN", key, match, count)
|
||||||
|
|
||||||
def eval(self, script, keys, *args):
|
def eval(self, script, keys, *args):
|
||||||
return self.execute_command('EVAL', script, len(keys), *keys, *args)
|
n = len(keys)
|
||||||
|
args = list_or_args(keys, args)
|
||||||
|
return self.execute_command('EVAL', script, n, *args)
|
||||||
|
|
||||||
def evalsha(self, sha1, keys, *args):
|
def evalsha(self, sha1, keys, *args):
|
||||||
return self.execute_command('EVALSHA', sha1, len(keys), *keys, *args)
|
n = len(keys)
|
||||||
|
args = list_or_args(keys, args)
|
||||||
|
return self.execute_command('EVALSHA', sha1, n, *args)
|
||||||
|
|
||||||
def scriptload(self, script):
|
def scriptload(self, script):
|
||||||
return self.execute_command('SCRIPT', 'LOAD', script)
|
return self.execute_command('SCRIPT', 'LOAD', script)
|
||||||
|
|
|
@ -19,6 +19,7 @@ class TestCmdScript(unittest.TestCase):
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def testEval(self):
|
||||||
|
assert l.eval("return {KEYS[1],KEYS[2],ARGV[1],ARGV[2]}", ["key1", "key2"], "first", "second") == ["key1", "key2", "first", "second"]
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue