diff --git a/aqt/main.py b/aqt/main.py index 4e89481f6..608cec7ee 100644 --- a/aqt/main.py +++ b/aqt/main.py @@ -4,7 +4,7 @@ import re import signal -import zipfile +import zipfile from send2trash import send2trash from aqt.qt import * diff --git a/aqt/qt.py b/aqt/qt.py index 168c75cc4..a46aec0b9 100644 --- a/aqt/qt.py +++ b/aqt/qt.py @@ -2,9 +2,13 @@ # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html # imports are all in this file to make moving to pyside easier in the future +# fixme: make sure not to optimize imports on this file + +import sip +import os -import sip, os from anki.utils import isWin, isMac + sip.setapi('QString', 2) sip.setapi('QVariant', 2) sip.setapi('QUrl', 2) @@ -18,14 +22,16 @@ from PyQt4.QtGui import * from PyQt4.QtWebKit import QWebPage, QWebView, QWebSettings from PyQt4.QtNetwork import QLocalServer, QLocalSocket + def debug(): from PyQt4.QtCore import pyqtRemoveInputHook from pdb import set_trace pyqtRemoveInputHook() set_trace() +import sys, traceback + if os.environ.get("DEBUG"): - import sys, traceback def info(type, value, tb): from PyQt4.QtCore import pyqtRemoveInputHook for line in traceback.format_exception(type, value, tb):