mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -04:00
tweak imports to work around tooling incorrectly finding module unused
fixes 'quit' from the profile menu, etc
This commit is contained in:
parent
33984b1f60
commit
cc98ef3763
2 changed files with 9 additions and 3 deletions
10
aqt/qt.py
10
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):
|
||||
|
|
Loading…
Reference in a new issue