Remove trailing whitespaces.

This commit is contained in:
Emmanuel Gil Peyrot 2013-01-18 17:55:34 +01:00
commit 27b3592e16

View file

@ -83,7 +83,7 @@ class CS_Plugin():
def dataLoaded(ignore):
if not self.data[profile]:
self.data[profile] = {'cookies':{}}
self.data[profile].load().addCallback(dataLoaded)
def profileDisconnected(self, profile):
@ -104,10 +104,10 @@ class CS_Plugin():
self.host.bridge.actionResult("ERROR", id, message_data)
return
post_data = urllib.urlencode({'auth_login[un]':login,'auth_login[pw]':password,'auth_login[action]':'Login...'})
post_data = urllib.urlencode({'auth_login[un]':login,'auth_login[pw]':password,'auth_login[action]':'Login...'})
self.data[profile]['cookies'] = {}
d = getPage('http://www.couchsurfing.org/login.html', method='POST', postdata=post_data, headers={'Content-Type':'application/x-www-form-urlencoded'} , agent=AGENT, cookies=self.data[profile]['cookies'])
d.addCallback(self.__connectionCB, id, profile)
d.addErrback(self.erroCB, id)
@ -193,7 +193,7 @@ class CS_Plugin():
friend_id = regex_href.search(unicode(a_tag)).groups()[0]
debug(_("CS friend found: %(friend_name)s (id: %(friend_id)s, link: %(friend_link)s)") % {'friend_name':friend_name, 'friend_id':friend_id, 'friend_link':friend_link})
friends[friend_name] = {'link':friend_link,'id':friend_id}
friends[friend_name] = {'link':friend_link,'id':friend_id}
a = soup.find('td','barmiddle next').a #is there several pages ?
if a:
#yes, we parse the next page
@ -255,7 +255,7 @@ class CS_Plugin():
message = data['message']
info(_("sending message to %(friends)s with subject [%(subject)s]" % {'friends':friends, 'subject':subject}))
self.__sendMessage(None, subject, message, self.data[profile], friends, id, profile)
def __showUnreadMessages2(self, html, id, profile):
"""Called when the inbox page has been received"""
#FIXME: that's really too fragile, only works if the unread messages are in the first page, and it would be too resources consuming for the website to DL each time all pages. In addition, the show attribute doesn't work as expected.
@ -269,4 +269,4 @@ class CS_Plugin():
d = getPage("http://www.couchsurfing.org/messages.html?message_status=inbox&show=10000", agent=AGENT, cookies=self.data[profile]['cookies'])
d.addCallback(self.__showUnreadMessages2, id, profile)
d.addErrback(self.erroCB, id)