diff --git a/dosagelib/director.py b/dosagelib/director.py index 4c8c4eabe..31b7c28cb 100644 --- a/dosagelib/director.py +++ b/dosagelib/director.py @@ -7,18 +7,9 @@ from __future__ import absolute_import, division, print_function import os import threading -try: - import _thread as thread -except ImportError: - import thread -try: - from Queue import Queue, Empty -except ImportError: - from queue import Queue, Empty -try: - from urllib.parse import urlparse -except ImportError: - from urlparse import urlparse +from six.moves import _thread +from six.moves.queue import Queue, Empty +from six.moves.urllib.parse import urlparse from .output import out from . import events, scraper @@ -94,7 +85,7 @@ class ComicGetter(threading.Thread): except Empty: pass except KeyboardInterrupt: - thread.interrupt_main() + _thread.interrupt_main() def getStrips(self, scraperobj): """Download comic strips.""" diff --git a/dosagelib/events.py b/dosagelib/events.py index 600943acd..3b2ad4176 100644 --- a/dosagelib/events.py +++ b/dosagelib/events.py @@ -1,13 +1,16 @@ -# -*- coding: iso-8859-1 -*- +# -*- coding: utf-8 -*- # Copyright (C) 2004-2005 Tristan Seligmann and Jonathan Jacobs +# Copyright (C) 2012-2014 Bastian Kleineidam +# Copyright (C) 2015-2016 Tobias Gruetzmacher + +from __future__ import absolute_import, division, print_function + import os import time -try: - from urllib.parse import quote as url_quote -except ImportError: - from urllib import quote as url_quote +from six.moves.urllib.parse import quote as url_quote import codecs import json + from . import rss, util, configuration from .output import out @@ -189,7 +192,7 @@ class HtmlEventHandler(EventHandler): Comics for %s -''' % (self.encoding, configuration.App, time.strftime('%Y/%m/%d', today))) +''' % (self.encoding, configuration.App, time.strftime('%Y/%m/%d', today))) self.addNavLinks() self.html.write(u'