diff options
author | Will Maier <willmaier@ml1.net> | 2011-01-06 10:37:31 -0600 |
---|---|---|
committer | Will Maier <willmaier@ml1.net> | 2011-01-06 10:37:31 -0600 |
commit | 518801e263d2c014eb3dfb76201ba8015c1bd1e1 (patch) | |
tree | 06e412955a4074189fc4f5f4aaafe0bae00f45d5 /redis/client.py | |
parent | db74ce9aa9ca7ffae9eb93b2037c4311805d3132 (diff) | |
download | redis-py-518801e263d2c014eb3dfb76201ba8015c1bd1e1.tar.gz |
add repr_command(), a function to consistently represent commands
Diffstat (limited to 'redis/client.py')
-rw-r--r-- | redis/client.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/redis/client.py b/redis/client.py index c473444..56d5af9 100644 --- a/redis/client.py +++ b/redis/client.py @@ -159,6 +159,14 @@ def dict_merge(*dicts): [merged.update(d) for d in dicts] return merged +def repr_command(args): + "Represents a command as a string." + command = [args[0]] + if len(args) > 1: + command.extend(repr(x) for x in args[1:]) + + return ' '.join(command) + def parse_info(response): "Parse the result of Redis's INFO command into a Python dict" info = {} |