mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 15:02:21 -04:00
disable obsolete plugins
This commit is contained in:
parent
bfd4f7577d
commit
ad08ad07f9
1 changed files with 17 additions and 0 deletions
|
@ -2618,6 +2618,7 @@ This deck already exists on your computer. Overwrite the local copy?"""),
|
||||||
def loadPlugins(self):
|
def loadPlugins(self):
|
||||||
if sys.platform.startswith("win32"):
|
if sys.platform.startswith("win32"):
|
||||||
self.clearPluginCache()
|
self.clearPluginCache()
|
||||||
|
self.disableObsoletePlugins()
|
||||||
plugdir = self.pluginsFolder()
|
plugdir = self.pluginsFolder()
|
||||||
sys.path.insert(0, plugdir)
|
sys.path.insert(0, plugdir)
|
||||||
plugins = self.enabledPlugins()
|
plugins = self.enabledPlugins()
|
||||||
|
@ -2642,6 +2643,22 @@ This deck already exists on your computer. Overwrite the local copy?"""),
|
||||||
continue
|
continue
|
||||||
os.unlink(os.path.join(curdir, f))
|
os.unlink(os.path.join(curdir, f))
|
||||||
|
|
||||||
|
def disableObsoletePlugins(self):
|
||||||
|
dir = self.pluginsFolder()
|
||||||
|
plugins = [
|
||||||
|
("Custom Media Directory.py", _("""\
|
||||||
|
The custom media folder plugin has been disabled, as Anki supports \
|
||||||
|
this natively now. Please visit the preferences screen.""")),
|
||||||
|
("Regenerate Reading Field.py", _("""\
|
||||||
|
The regenerate reading field plugin has been disabled, as the Japanese \
|
||||||
|
support plugin supports this now. Please download the latest version."""))
|
||||||
|
]
|
||||||
|
for p in plugins:
|
||||||
|
path = os.path.join(dir, p[0])
|
||||||
|
if os.path.exists(path):
|
||||||
|
os.rename(path, path.replace(".py", ".disabled"))
|
||||||
|
ui.utils.showInfo(p[1])
|
||||||
|
|
||||||
def rebuildPluginsMenu(self):
|
def rebuildPluginsMenu(self):
|
||||||
if getattr(self, "pluginActions", None) is None:
|
if getattr(self, "pluginActions", None) is None:
|
||||||
self.pluginActions = []
|
self.pluginActions = []
|
||||||
|
|
Loading…
Reference in a new issue