Commit 259adfb2 authored by prx's avatar prx

minor fixes for python2.7

parent f59c9175
......@@ -557,7 +557,10 @@ class DontPanic:
whoami = request.get_cookie("username", secret=self.secret)
list_ep_serie = getseriestuff(title, year, user=whoami)
lang = locale.setlocale(locale.LC_ALL, "")[0:2] # 'fr' or 'en'
try:
lang = locale.setlocale(locale.LC_ALL, "")[0:2] # 'fr' or 'en'
except:
lang = 'en'
tplvars = {
'title': title,
'title_simplify': title_simplify,
......
......@@ -28,7 +28,7 @@ if language.info():
else:
logger.info("Your language ({}) is not translated".format(current_locale))
if sys.version_info >= (3, 0):
if sys.version_info >= (2, 7):
_ = language.gettext
else:
# Support of unicode for version of Python older than 3
......
File mode changed from 100755 to 100644
......@@ -339,7 +339,7 @@ tpl_msg = {'tpl_about': _("About"),
"</a> for more information. You can find <a href='http://proxylist.hidemyass.com"
"/'>a list of free proxy here</a> or <a href='http://www.samair.ru/proxy/'>here"
"</a>."),
'tpl_not_last_version': _(" Upgrade dontpanic")
'tpl_not_last_version': _("> Upgrade dontpanic")
}
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
......@@ -560,6 +560,9 @@ class TorrentSearch:
if __name__ == '__main__':
omdb_sch("flash")
with TorrentSearch('btdigg') as ts:
s = ts.search('flash', 0)
print(s)
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment