Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ai
autoca
Commits
ac81d393
Commit
ac81d393
authored
Jan 08, 2012
by
ale
Browse files
ignore None values in hmget() result
parent
d39fcc70
Changes
1
Hide whitespace changes
Inline
Side-by-side
autovpn/acct.py
View file @
ac81d393
...
...
@@ -62,8 +62,10 @@ class Accounting(object):
while
True
:
try
:
pipe
.
watch
(
aggr_key
)
old_values
=
[
json
.
loads
(
x
)
for
x
in
pipe
.
hmget
(
aggr_key
,
days
)]
old_aggr
=
dict
(
zip
(
days
,
old_values
))
old_aggr
=
{}
for
day
,
data
in
zip
(
days
,
pipe
.
hmget
(
aggr_key
,
days
)):
if
data
:
old_aggr
[
day
]
=
json
.
loads
(
data
)
pipe
.
multi
()
for
day
,
aggr_data
in
aggr
.
iteritems
():
old_aggr_data
=
old_aggr
.
get
(
day
,
{})
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment