boobot: Better newline handling
This commit is contained in:
parent
1b2031796b
commit
8825072829
1 changed files with 4 additions and 2 deletions
|
|
@ -104,7 +104,8 @@ class BoobotBrowser(StandardBrowser):
|
|||
encoding = EncodingFinder('windows-1252').encoding(r).lower().replace('iso-8859-1', 'windows-1252')
|
||||
h = self.get_document(r, parser='lxml', encoding=encoding)
|
||||
for title in h.xpath('//head/title'):
|
||||
title = to_unicode(title.text_content())
|
||||
title = to_unicode(title.text_content()).strip()
|
||||
title = ' '.join(title.splitlines())
|
||||
return content_type, hsize, title
|
||||
|
||||
def human_size(self, size):
|
||||
|
|
@ -194,7 +195,8 @@ class Boobot(SingleServerIRCBot):
|
|||
self.joined[channel].set()
|
||||
|
||||
def send_message(self, msg, channel=None):
|
||||
self.connection.privmsg(channel or self.mainchannel, msg)
|
||||
for m in msg.splitlines():
|
||||
self.connection.privmsg(channel or self.mainchannel, m)
|
||||
|
||||
def on_pubmsg(self, c, event):
|
||||
# irclib 5.0 compatibility
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue