Add command-line argument to skip addons

Shift doesn't work for me occasionally, for whatever reason. So just add an -s to skip it that way.

(Also, update my github nick)
This commit is contained in:
Andreas Reis 2020-10-12 21:57:49 +02:00
parent 1e37e6cabd
commit 21f072a666
3 changed files with 7 additions and 2 deletions

View file

@ -51,7 +51,7 @@ Andrew Gaul <andrew@gaul.org>
kenden
Nickolay Yudin <kelciour@gmail.com>
neitrinoweb <github.com/neitrinoweb/>
Andreas Reis <github.com/rathsky>
Andreas Reis <github.com/nwwt>
Matt Krump <github.com/mkrump>
Alexander Presnyakov <flagist0@gmail.com>
abdo <github.com/abdnh>

View file

@ -319,6 +319,9 @@ def parseArgs(argv):
parser.add_argument("-p", "--profile", help="profile name to load", default="")
parser.add_argument("-l", "--lang", help="interface language (en, de, etc)")
parser.add_argument("-v", "--version", help="print the Anki version and exit")
parser.add_argument(
"-s", "--safemode", help="disable addons and automatic syncing temporarily"
)
return parser.parse_known_args(argv[1:])

View file

@ -112,7 +112,9 @@ class AnkiQt(QMainWindow):
self.app = app
self.pm = profileManager
# init rest of app
self.safeMode = self.app.queryKeyboardModifiers() & Qt.ShiftModifier
self.safeMode = (
self.app.queryKeyboardModifiers() & Qt.ShiftModifier
) or self.opts.safemode
try:
self.setupUI()
self.setupAddons(args)