New issue 26 by rhard...@mitechie.com: not all IM entries have a protocol
http://code.google.com/p/goobook/issues/detail?id=26
What steps will reproduce the problem?
When I query my contacts, _parse_contact break on the IM parsing of my
contact.
Entry (from line 305 of current git code):
for ent in entry.findall(G_NS + 'im'):
>> [('rel', 'http://schemas.google.com/g/2005#other'), ('address', 'AIM:
>> $username')]
The record has no protocol so the splitting of it causes:
Traceback (most recent call last):
File "/home/rharding/src/goobook/bin/goobook", line 9, in <module>
load_entry_point('goobook==1.4.dev', 'console_scripts', 'goobook')()
File "/home/rharding/src/goobook/src/goobook/application.py", line 83, in
main
args.func(config, args)
File "/home/rharding/src/goobook/src/goobook/application.py", line 111,
in do_query
goobk = GooBook(config)
File "/home/rharding/src/goobook/src/goobook/goobook.py", line 59, in
__init__
self.cache.load()
File "/home/rharding/src/goobook/src/goobook/goobook.py", line 242, in
load
self.update()
File "/home/rharding/src/goobook/src/goobook/goobook.py", line 249, in
update
self.contacts = list(self._parse_contacts(gc.fetch_contacts()))
File "/home/rharding/src/goobook/src/goobook/goobook.py", line 326, in
_parse_contacts
yield self._parse_contact(entry)
File "/home/rharding/src/goobook/src/goobook/goobook.py", line 310, in
_parse_contact
contact.im.append((ent.get('address'),
ent.get('protocol').split('#')[-1]))
AttributeError: 'NoneType' object has no attribute 'split'
What version of the product are you using? On what operating system?
goobook 1.4alpha4 on Ubuntu Maverick
Please provide any additional information below.
I'm not 100% sure how this is supposed to work so I'm hesitant to sumbit a
patch that just checks for a protocol before attempting to split it. A
quick search for 'contact.im' only shows it in a print view of contacts.
Not sure if you want a "none", or 'N/A' or what as the output of that.
Let me know if you need any testing/feedback on the issue.
Comment #1 on issue 26 by h...@furuvik.net: not all IM entries have a
protocol
http://code.google.com/p/goobook/issues/detail?id=26
I have commited an untested fix to the master branch, it should now
print "Unknown" if there is no protocol.
Please test and let me hear.
Tested master and that seems to be working out. Thanks for the update.
Comment #3 on issue 26 by h...@furuvik.net: not all IM entries have a
protocol
http://code.google.com/p/goobook/issues/detail?id=26
(No comment was entered for this change.)
Issue 27 has been merged into this issue.