diff --git a/EDMarketConnector.py b/EDMarketConnector.py index 36898f3f..cee1a52a 100755 --- a/EDMarketConnector.py +++ b/EDMarketConnector.py @@ -299,6 +299,13 @@ class AppWindow: self.postprefs(False) # Companion login happens in callback from monitor + if len(plug.PLUGINS_not_py3): + import tkMessageBox + tkMessageBox.showinfo('Plugins Without Python 3.x Support', + "One or more of your enabled plugins do not yet have support for Python 3.x. Please see the list on the 'Plugins' tab of 'File' > 'Settings'. You should check if there is an updated version available, else alert the developer that they will need to update the code when EDMC moves to Python 3.x" + ) + + # callback after the Preferences dialog is applied def postprefs(self, dologin=True): self.prefsdialog = None diff --git a/plug.py b/plug.py index e6b0e87d..0577c607 100644 --- a/plug.py +++ b/plug.py @@ -65,6 +65,7 @@ GuiFocusCodex = 11 # List of loaded Plugins PLUGINS = [] +PLUGINS_not_py3 = [] # For asynchronous error display last_error = { @@ -195,6 +196,14 @@ def load_plugins(master): print_exc() PLUGINS.extend(sorted(found, key = lambda p: operator.attrgetter('name')(p).lower())) + ######################################################### + # Detect plugins that aren't yet ready for Python 3.x + ######################################################### + for p in PLUGINS: + if p.module and p.folder and not p._get_func('plugin_start3'): + PLUGINS_not_py3.append(p) + ######################################################### + imp.release_lock() def provides(fn_name): diff --git a/prefs.py b/prefs.py index 5096d194..3a5024c8 100644 --- a/prefs.py +++ b/prefs.py @@ -273,6 +273,18 @@ class PreferencesDialog(tk.Toplevel): label = nb.Label(plugsframe, text='%s (%s)' % (plugin.folder, plugin.name)) label.grid(columnspan=2, padx=PADX*2, sticky=tk.W) + ############################################################ + # Show which plugins don't have Python 3.x support + ############################################################ + if len(plug.PLUGINS_not_py3): + ttk.Separator(plugsframe, orient=tk.HORIZONTAL).grid(columnspan=3, padx=PADX, pady=PADY * 8, sticky=tk.EW) + nb.Label(plugsframe, text=_('Plugins Without Python 3.x Support')+':').grid(padx=PADX, sticky=tk.W) # List of plugins in settings + for plugin in plug.PLUGINS_not_py3: + if plugin.folder: # 'system' ones have this set to None to suppress listing in Plugins prefs tab + nb.Label(plugsframe, text=plugin.name).grid(columnspan=2, padx=PADX*2, sticky=tk.W) + + ############################################################ + disabled_plugins = [x for x in plug.PLUGINS if x.folder and not x.module] if len(disabled_plugins): ttk.Separator(plugsframe, orient=tk.HORIZONTAL).grid(columnspan=3, padx=PADX, pady=PADY * 8, sticky=tk.EW)