Fix pushbullet compatibility with python 2.6
Remove dict comprehension usage.
This commit is contained in:
parent
2753cd186a
commit
bab763de89
1 changed files with 6 additions and 2 deletions
|
@ -144,7 +144,9 @@ def main():
|
||||||
|
|
||||||
# Search for given device
|
# Search for given device
|
||||||
if device is not None:
|
if device is not None:
|
||||||
devices_by_nickname = {d.nickname: d for d in pb.devices}
|
devices_by_nickname = {}
|
||||||
|
for d in pb.devices:
|
||||||
|
devices_by_nickname[d.nickname] = d
|
||||||
|
|
||||||
if device in devices_by_nickname:
|
if device in devices_by_nickname:
|
||||||
target = devices_by_nickname[device]
|
target = devices_by_nickname[device]
|
||||||
|
@ -153,7 +155,9 @@ def main():
|
||||||
|
|
||||||
# Search for given channel
|
# Search for given channel
|
||||||
if channel is not None:
|
if channel is not None:
|
||||||
channels_by_tag = {c.channel_tag: c for c in pb.channels}
|
channels_by_tag = {}
|
||||||
|
for c in pb.channels:
|
||||||
|
channels_by_tag[c.channel_tag] = c
|
||||||
|
|
||||||
if channel in channels_by_tag:
|
if channel in channels_by_tag:
|
||||||
target = channels_by_tag[channel]
|
target = channels_by_tag[channel]
|
||||||
|
|
Loading…
Reference in a new issue