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 import aqt.forms
from anki.utils import versionWithBuild from anki.utils import versionWithBuild
from aqt.utils import supportText, tooltip from aqt.utils import supportText, tooltip
from anki.lang import _
class ClosableQDialog(QDialog): class ClosableQDialog(QDialog):
def reject(self): def reject(self):

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -5,6 +5,7 @@
from aqt.qt import * from aqt.qt import *
import aqt import aqt
from aqt.utils import showWarning, openHelp, askUser, saveGeom, restoreGeom from aqt.utils import showWarning, openHelp, askUser, saveGeom, restoreGeom
from anki.lang import _
class DeckConf(QDialog): class DeckConf(QDialog):
def __init__(self, mw, first=False, search="", deck=None): 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 aqt.utils import saveGeom, restoreGeom
from anki.hooks import addHook, remHook from anki.hooks import addHook, remHook
from anki.utils import isMac from anki.utils import isMac
from anki.lang import _
class EditCurrent(QDialog): class EditCurrent(QDialog):

View File

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

View File

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

View File

@ -18,8 +18,7 @@ from anki.hooks import addHook, remHook
import aqt.forms import aqt.forms
import aqt.modelchooser import aqt.modelchooser
import aqt.deckchooser import aqt.deckchooser
from anki.lang import ngettext from anki.lang import ngettext, _
class ChangeMap(QDialog): class ChangeMap(QDialog):
def __init__(self, mw, model, current): 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, \ restoreState, getOnlyText, askUser, showText, tooltip, \
openHelp, openLink, checkInvalidFilename, getFile openHelp, openLink, checkInvalidFilename, getFile
from aqt.qt import sip from aqt.qt import sip
from anki.lang import _, ngettext
class AnkiQt(QMainWindow): class AnkiQt(QMainWindow):
def __init__(self, app, profileManager, opts, args): 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 anki.hooks import addHook, remHook, runHook
from aqt.utils import shortcut from aqt.utils import shortcut
import aqt import aqt
from anki.lang import _
class ModelChooser(QHBoxLayout): class ModelChooser(QHBoxLayout):

View File

@ -8,6 +8,7 @@ import aqt.clayout
from anki import stdmodels from anki import stdmodels
from aqt.utils import saveGeom, restoreGeom from aqt.utils import saveGeom, restoreGeom
import collections import collections
from anki.lang import _, ngettext
class Models(QDialog): class Models(QDialog):
def __init__(self, mw, parent=None, fromMain=False): 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 from anki.utils import isMac
import aqt import aqt
from anki.sound import clearAudioQueue from anki.sound import clearAudioQueue
from anki.lang import _
class Overview: class Overview:
"Deck overview." "Deck overview."

View File

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

View File

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

View File

@ -5,6 +5,7 @@
import time import time
from aqt.qt import * from aqt.qt import *
import aqt.forms import aqt.forms
from anki.lang import _
# fixme: if mw->subwindow opens a progress dialog with mw as the parent, mw # 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 # 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 import time
from anki.sound import Recorder from anki.sound import Recorder
from aqt.utils import saveGeom, restoreGeom, showWarning from aqt.utils import saveGeom, restoreGeom, showWarning
from anki.lang import _
if not Recorder: if not Recorder:
print("pyaudio not installed") print("pyaudio not installed")

View File

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

View File

@ -6,6 +6,7 @@ from aqt.qt import *
import aqt import aqt
from aqt.utils import showInfo, openHelp, getOnlyText, shortcut, restoreGeom, saveGeom from aqt.utils import showInfo, openHelp, getOnlyText, shortcut, restoreGeom, saveGeom
from anki.hooks import addHook, remHook from anki.hooks import addHook, remHook
from anki.lang import _
class StudyDeck(QDialog): class StudyDeck(QDialog):
def __init__(self, mw, names=None, accept=None, title=None, 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 RemoteMediaServer
from anki.hooks import addHook, remHook from anki.hooks import addHook, remHook
from aqt.utils import tooltip, askUserDialog, showWarning, showText, showInfo from aqt.utils import tooltip, askUserDialog, showWarning, showText, showInfo
from anki.lang import _
# Sync manager # Sync manager
###################################################################### ######################################################################

View File

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

View File

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

View File

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

View File

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