Merge branch 'testing' of github.com:ProgVal/Limnoria into l10n-fi

This commit is contained in:
Mikaela Suomalainen 2014-03-22 14:34:01 +02:00
commit 8d85d01838
3 changed files with 13 additions and 10 deletions

View File

@ -13,8 +13,3 @@ script:
- echo $TRAVIS_PYTHON_VERSION
- python setup.py install
- supybot-test test --plugins-dir=./build/lib*/supybot/plugins/ --no-network --disable-multiprocessing --exclude=./build/lib*/supybot/plugins/Scheduler --exclude=./build/lib*/supybot/plugins/Filter
notifications:
irc:
channels:
- "chat.freenode.net#limnoria"
on_success: change

View File

@ -1,6 +1,6 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR ORGANIZATION
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
# Aka plugin for Limnoria
# Copyright (C) 2014 Limnoria
# Mikaela Suomalainen <mikaela.suomalainen@outlook.com>, 2014.
#
msgid ""
msgstr ""

View File

@ -151,13 +151,21 @@ class RSS(callbacks.Plugin):
pubDate = ' [%s]' % (headline[2],)
if sys.version_info[0] < 3:
if isinstance(headline[0], unicode):
try:
import charade.universaldetector
u = charade.universaldetector.UniversalDetector()
u.feed(headline[0])
u.close()
encoding = u.result['encoding']
except ImportError:
encoding = 'utf8'
newheadlines.append(format('%s %u%s',
headline[0].encode('utf-8','replace'),
headline[0].encode(encoding,'replace'),
link,
pubDate))
else:
newheadlines.append(format('%s %u%s',
headline[0].decode('utf-8','replace'),
headline[0],
link,
pubDate))
else: