tweak imports to work around tooling incorrectly finding module unused

fixes 'quit' from the profile menu, etc
This commit is contained in:
Damien Elmes 2013-12-19 07:41:29 +09:00
parent 33984b1f60
commit cc98ef3763
2 changed files with 9 additions and 3 deletions

View file

@ -4,7 +4,7 @@
import re
import signal
import zipfile
import zipfile
from send2trash import send2trash
from aqt.qt import *

View file

@ -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):