Skip to content
This repository has been archived by the owner on Jul 7, 2022. It is now read-only.

get_channel doesn't work #92

Closed
Officedr0ne opened this issue Aug 21, 2016 · 10 comments
Closed

get_channel doesn't work #92

Officedr0ne opened this issue Aug 21, 2016 · 10 comments

Comments

@Officedr0ne
Copy link

Officedr0ne commented Aug 21, 2016

my_channel = pb.channels[0]
Or retrieve a channel by its channel_tag. Note that an InvalidKeyError is raised if the channel_tag does not exist
my_channel = pb.get_channel('My Channel')

So pb.channels works fine, but pb.get_channel returns an error that pushbullet doesn't have that object. Any idea what might be wrong?

@simonporter007
Copy link
Contributor

It's only a one liner which tries to pull out the channel by tagname:
req_channel = next((channel for channel in self.channels if channel.channel_tag == channel_tag), None)

So I can only presume that the channel_tag doesn't match any channel.channel_tag of your pb.channels, returning None instead. Can you reproduce this and give the specific channel names from the output of pb.channels and your call to get_channel()?

@elanorigby
Copy link

I'm having this same issue, but I'm certain the tag name is right.

print(pb.channels) -> [Channel(name: 'PEP_o_the_Morning' tag: 'pepo')]

print(pb.get_channel('pepo')) -> AttributeError: 'Pushbullet' object has no attribute 'get_channel'

@simonporter007
Copy link
Contributor

Ah. So I must have misread the original issue, apologies. It's clear with the last update. It looks like Pushbullet object doesn't have that method, which I can only presume is because the latest release hasn't included the more recent commit's. I added the get_channel method in #73

@elanorigby are you using a pusbullet.py version from git or from pip or something else?

@elanorigby
Copy link

I'm in the pip zone. Thanks for the quick response!

@simonporter007
Copy link
Contributor

@kovacsbalu @r-darwish Seems like a lot of code missing from the pip release. What's the plans for the next one?

@kovacsbalu
Copy link
Collaborator

@simonporter007 I don't know. Who manage pushbullet.py pip releases? Not me :)

@simonporter007
Copy link
Contributor

Ha ha! Well in that case no idea, I don't think randomchars is about these days. Might just have to recommend using git instead!

@r-darwish
Copy link
Collaborator

@simonporter007 I don't think I have permissions to upload a package to PyPi. In any case, I stopped using PushBullet a while ago so it's probably best if @RandomChars will put someone else as a collaborator instead of me.

@simonporter007
Copy link
Contributor

@elanorigby Looks like they just created 0.11 tag which should get pushed to pypi. Should sort your issue if you upgrade it or if you've switched to install from git instead, then no worries.

@elanorigby
Copy link

Awesome, thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants