Added a helpful iterator to redis. Fixed some issues with stderr in osproc. Fixed doc generation issues.

This commit is contained in:
dom96 2011-05-22 19:25:29 +01:00
commit 23da2a0eaa
5 changed files with 1490 additions and 980 deletions

View file

@ -846,6 +846,19 @@ proc slaveof*(r: TRedis, host: string, port: string) =
r.sendCommand("SLAVEOF", host, port)
raiseNoOK(r.parseStatus())
iterator hPairs*(r: TRedis, key: string): tuple[key, value: string] =
## Iterator for keys and values in a hash.
var
contents = r.hGetAll(key)
k = ""
for i in items(contents):
if k == "":
k = i
else:
yield (k, i)
k = ""
when false:
# sorry, deactivated for the test suite
var r = open()