explicitly import _ and ngettext

This commit is contained in:
Damien Elmes 2019-03-04 11:58:34 +10:00
parent 4a9bb2d396
commit da2ddcc6e2
29 changed files with 29 additions and 8 deletions

View File

@ -6,6 +6,7 @@ from aqt.qt import *
import aqt.forms
from anki.utils import versionWithBuild
from aqt.utils import supportText, tooltip
from anki.lang import _
class ClosableQDialog(QDialog):
def reject(self):

View File

@ -17,7 +17,7 @@ from zipfile import ZipFile
import aqt.forms
import aqt
from aqt.downloader import download
from anki.lang import _
from anki.lang import _, ngettext
from anki.utils import intTime
from anki.sync import AnkiRequestsClient

View File

@ -21,6 +21,7 @@ from aqt.utils import saveGeom, restoreGeom, saveSplitter, restoreSplitter, \
saveHeader, restoreHeader, saveState, restoreState, getTag, \
showInfo, askUser, tooltip, openHelp, showWarning, shortcut, mungeQA, \
getOnlyText, MenuList, SubMenu, qtMenuShortcutWorkaround
from anki.lang import _
from anki.hooks import runHook, addHook, remHook, runFilter
from aqt.webview import AnkiWebView
from anki.consts import *

View File

@ -16,7 +16,7 @@ from anki.utils import isMac, isWin, joinFields, bodyClass
from aqt.webview import AnkiWebView
import json
from anki.hooks import runFilter
from anki.lang import _, ngettext
class CardLayout(QDialog):

View File

@ -6,6 +6,7 @@ from aqt.qt import *
import aqt
from aqt.utils import showInfo, showWarning
from anki.consts import *
from anki.lang import _
RADIO_NEW = 1
RADIO_REV = 2

View File

@ -11,6 +11,7 @@ import aqt
from anki.sound import clearAudioQueue
from anki.hooks import runHook
from copy import deepcopy
from anki.lang import _, ngettext
class DeckBrowser:

View File

@ -5,6 +5,7 @@
from aqt.qt import *
from anki.hooks import addHook, remHook
from aqt.utils import shortcut
from anki.lang import _
class DeckChooser(QHBoxLayout):

View File

@ -8,7 +8,7 @@ from aqt.qt import *
import aqt
from aqt.utils import showInfo, showWarning, openHelp, getOnlyText, askUser, \
tooltip, saveGeom, restoreGeom, downArrow
from anki.lang import _, ngettext
class DeckConf(QDialog):
def __init__(self, mw, deck):

View File

@ -8,6 +8,7 @@ from anki.sync import AnkiRequestsClient
from aqt.utils import showWarning
from anki.hooks import addHook, remHook
import aqt
from anki.lang import _
def download(mw, code):
"Download addon from AnkiWeb. Caller must start & stop progress diag."

View File

@ -5,6 +5,7 @@
from aqt.qt import *
import aqt
from aqt.utils import showWarning, openHelp, askUser, saveGeom, restoreGeom
from anki.lang import _
class DeckConf(QDialog):
def __init__(self, mw, first=False, search="", deck=None):

View File

@ -8,7 +8,7 @@ import aqt.editor
from aqt.utils import saveGeom, restoreGeom
from anki.hooks import addHook, remHook
from anki.utils import isMac
from anki.lang import _
class EditCurrent(QDialog):

View File

@ -10,7 +10,7 @@ from aqt.utils import getSaveFile, tooltip, showWarning, askUser, \
checkInvalidFilename, showInfo
from anki.exporting import exporters
from anki.hooks import addHook, remHook
from anki.lang import ngettext
from anki.lang import ngettext, _
import time
class ExportDialog(QDialog):

View File

@ -5,6 +5,7 @@ from aqt.qt import *
from anki.consts import *
import aqt
from aqt.utils import showWarning, openHelp, getOnlyText, askUser
from anki.lang import _, ngettext
class FieldDialog(QDialog):

View File

@ -18,8 +18,7 @@ from anki.hooks import addHook, remHook
import aqt.forms
import aqt.modelchooser
import aqt.deckchooser
from anki.lang import ngettext
from anki.lang import ngettext, _
class ChangeMap(QDialog):
def __init__(self, mw, model, current):

View File

@ -30,6 +30,7 @@ from aqt.utils import saveGeom, restoreGeom, showInfo, showWarning, \
restoreState, getOnlyText, askUser, showText, tooltip, \
openHelp, openLink, checkInvalidFilename, getFile
from aqt.qt import sip
from anki.lang import _, ngettext
class AnkiQt(QMainWindow):
def __init__(self, app, profileManager, opts, args):

View File

@ -6,6 +6,7 @@ from aqt.qt import *
from anki.hooks import addHook, remHook, runHook
from aqt.utils import shortcut
import aqt
from anki.lang import _
class ModelChooser(QHBoxLayout):

View File

@ -8,6 +8,7 @@ import aqt.clayout
from anki import stdmodels
from aqt.utils import saveGeom, restoreGeom
import collections
from anki.lang import _, ngettext
class Models(QDialog):
def __init__(self, mw, parent=None, fromMain=False):

View File

@ -6,6 +6,7 @@ from aqt.utils import openLink, shortcut, tooltip, askUserDialog
from anki.utils import isMac
import aqt
from anki.sound import clearAudioQueue
from anki.lang import _
class Overview:
"Deck overview."

View File

@ -8,6 +8,7 @@ import anki.lang
from aqt.utils import openFolder, showWarning, getText, openHelp, showInfo, \
askUser
import aqt
from anki.lang import _
class Preferences(QDialog):

View File

@ -23,6 +23,7 @@ from aqt import appHelpSite
import aqt.forms
from send2trash import send2trash
import anki.sound
from anki.lang import _
metaConf = dict(
ver=0,

View File

@ -5,6 +5,7 @@
import time
from aqt.qt import *
import aqt.forms
from anki.lang import _
# fixme: if mw->subwindow opens a progress dialog with mw as the parent, mw
# gets raised on finish on compiz. perhaps we should be using the progress

View File

@ -6,6 +6,7 @@ from aqt.qt import *
import time
from anki.sound import Recorder
from aqt.utils import saveGeom, restoreGeom, showWarning
from anki.lang import _
if not Recorder:
print("pyaudio not installed")

View File

@ -7,6 +7,7 @@ import os, time
from aqt.utils import saveGeom, restoreGeom, maybeHideClose, addCloseShortcut, \
tooltip, getSaveFile
import aqt
from anki.lang import _
# Deck Stats
######################################################################

View File

@ -6,6 +6,7 @@ from aqt.qt import *
import aqt
from aqt.utils import showInfo, openHelp, getOnlyText, shortcut, restoreGeom, saveGeom
from anki.hooks import addHook, remHook
from anki.lang import _
class StudyDeck(QDialog):
def __init__(self, mw, names=None, accept=None, title=None,

View File

@ -12,7 +12,7 @@ from anki.sync import Syncer, RemoteServer, FullSyncer, MediaSyncer, \
RemoteMediaServer
from anki.hooks import addHook, remHook
from aqt.utils import tooltip, askUserDialog, showWarning, showText, showInfo
from anki.lang import _
# Sync manager
######################################################################

View File

@ -3,6 +3,7 @@
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
from aqt.qt import *
from anki.lang import _
class Toolbar:

View File

@ -9,6 +9,7 @@ from aqt.qt import *
import aqt
from aqt.utils import openLink, showText
from anki.utils import platDesc, versionWithBuild
from anki.lang import _
class LatestVersionFinder(QThread):

View File

@ -8,6 +8,7 @@ import aqt
from anki.sound import stripSounds
from anki.utils import isWin, isMac, invalidFilename, noBundledLibs, \
versionWithBuild
from anki.lang import _
def openHelp(section):
link = aqt.appHelpSite

View File

@ -8,6 +8,7 @@ from anki.hooks import runHook
from aqt.qt import *
from aqt.utils import openLink, showWarning, tooltip
from anki.utils import isMac, isWin, isLin, devMode
from anki.lang import _
# Page for debug messages
##########################################################################