From 21f072a666b39ebf4e45a836c3fddeb401a4ec05 Mon Sep 17 00:00:00 2001 From: Andreas Reis Date: Mon, 12 Oct 2020 21:57:49 +0200 Subject: [PATCH 1/2] 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) --- CONTRIBUTORS | 2 +- qt/aqt/__init__.py | 3 +++ qt/aqt/main.py | 4 +++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 1aa23d721..f304612ec 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -51,7 +51,7 @@ Andrew Gaul kenden Nickolay Yudin neitrinoweb -Andreas Reis +Andreas Reis Matt Krump Alexander Presnyakov abdo diff --git a/qt/aqt/__init__.py b/qt/aqt/__init__.py index 8fa8360c4..7ca2f7928 100644 --- a/qt/aqt/__init__.py +++ b/qt/aqt/__init__.py @@ -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:]) diff --git a/qt/aqt/main.py b/qt/aqt/main.py index a20ea514e..8cea38bcc 100644 --- a/qt/aqt/main.py +++ b/qt/aqt/main.py @@ -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) From 02ceab55c05db9ea73cc1ea87041bc74a6f16f9f Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Wed, 14 Oct 2020 09:45:34 +1000 Subject: [PATCH 2/2] Update __init__.py --- qt/aqt/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qt/aqt/__init__.py b/qt/aqt/__init__.py index 7ca2f7928..6dfcc858b 100644 --- a/qt/aqt/__init__.py +++ b/qt/aqt/__init__.py @@ -320,7 +320,7 @@ def parseArgs(argv): 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" + "-s", "--safemode", help="disable addons and automatic syncing" ) return parser.parse_known_args(argv[1:])