Merge lp:~jonathanjgster/ibid/jjg into lp:~ibid-core/ibid/old-trunk-pack-0.92

Proposed by Jonathan Groll
Status: Merged
Approved by: Stefano Rivera
Approved revision: 583
Merged at revision: 593
Proposed branch: lp:~jonathanjgster/ibid/jjg
Merge into: lp:~ibid-core/ibid/old-trunk-pack-0.92
Diff against target: None lines
To merge this branch: bzr merge lp:~jonathanjgster/ibid/jjg
Reviewer Review Type Date Requested Status
Stefano Rivera Approve
Michael Gorven Approve
Jonathan Hitchcock Approve
Review via email: mp+4911@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Jonathan Groll (jonathanjgster) wrote :

Delicious logic further fixes: new regexes work with both freenode and atrum's irc daemons; ibid.sources[event.source].type == 'jabber' added; redundant logging of exception message removed since log.exception does so anyway.

Revision history for this message
Jonathan Hitchcock (vhata) :
review: Approve
Revision history for this message
Michael Gorven (mgorven) wrote :

 review approve

review: Approve
Revision history for this message
Stefano Rivera (stefanor) wrote :

Erk, this got forgotten. Will merge now

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ibid/plugins/url.py'
2--- ibid/plugins/url.py 2009-03-25 10:35:11 +0000
3+++ ibid/plugins/url.py 2009-03-25 15:45:16 +0000
4@@ -34,7 +34,8 @@
5 class Delicious():
6
7 at_re = re.compile('@\S+?\.')
8- ip_re = re.compile('\.IP$')
9+ ip_re = re.compile('\.IP$|unaffiliated')
10+ con_re = re.compile('!n=|!')
11
12 def add_post(self,username,password,event,url=None):
13 "Posts a URL to delicious.com"
14@@ -42,14 +43,14 @@
15 date = datetime.now()
16 title = self._get_title(url)
17
18- connection_body = event.sender['connection'].split('!')
19+ connection_body = self.con_re.split(event.sender['connection'])
20 if len(connection_body) == 1:
21 connection_body.append(event.sender['connection'])
22
23 if self.ip_re.search(connection_body[1]) != None:
24 connection_body[1] = ""
25
26- if event.source == 'jabber':
27+ if ibid.sources[event.source].type == 'jabber':
28 obfusc_conn = ""
29 obfusc_chan = event.channel.replace('@', '^')
30 else:
31@@ -77,7 +78,7 @@
32 log.info(u"Successfully posted url %s to delicious, posted in channel %s by nick %s at time %s", \
33 url, event.channel, event.sender['nick'], date)
34 else:
35- log.error(u"Error posting url %s to delicious: %s", url, response)
36+ log.error(u"Error posting url %s to delicious: %s", url, resp)
37
38 def _get_title(self,url):
39 "Gets the title of a page"
40@@ -86,8 +87,8 @@
41 etree = get_html_parse_tree(url, None, headers, 'etree')
42 title = etree.findtext("head/title")
43 return title
44- except Exception, e:
45- log.exception(u"Delicious logic - error determining the title for url %s: %s", url, e.message)
46+ except Exception:
47+ log.exception(u"Delicious logic - error determining the title for url %s", url)
48 return url
49
50 def _set_auth(self,username,password):

Subscribers

People subscribed via source and target branches