From 7ed7f904a83f9d5557ce40663cd6154b3e16064a Mon Sep 17 00:00:00 2001 From: Athanasius Date: Fri, 19 Jun 2020 19:28:01 +0100 Subject: [PATCH 1/3] Adds an edited version of python3/PLUGINS.md#Migration for master branch We need this in master so that the forthcoming Python 2.7 version that detects plugins that aren't ready for migration can provide a link to information about migrating. In the future the 'python3' branch might have been removed. --- PLUGINS.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/PLUGINS.md b/PLUGINS.md index e43921bf..6f3fdd02 100644 --- a/PLUGINS.md +++ b/PLUGINS.md @@ -279,3 +279,12 @@ EDMC now lets you disable a plugin without deleting it, simply rename the plugin Disabled and enabled plugins are listed on the "Plugins" Settings tab +# Migration to Python 3.7 + +In a future release EDMC will use Python **3.7**, instead of the Python 2.7 it has historically used. As of mid-2020 there is a [python3 branch](/EDCD/EDMarketConnector/tree/python3) to test migrated plugins against. This is a brief outline of the steps required to migrate a plugin from earlier versions of EDMC: + +- Rename the function `plugin_start` to `plugin_start3(plugin_dir)`. Plugins without a `plugin_start3` function will be listed as disabled on EDMC's "Plugins" tab and a message like "plugin SuperSpaceHelper needs migrating" will appear in the log. +- Check that callback functions `plugin_prefs`, `prefs_changed`, `journal_entry`, `dashboard_entry` and `cmdr_data` if used are declared with the correct number of arguments. Older versions of this app were tolerant of missing arguments in these function declarations. +- Port the code to Python 3.7. The [2to3](https://docs.python.org/3/library/2to3.html) tool can automate much of this work. + +Depending on the complexity of the plugin it may be feasible to make it compatible with both EDMC 3.4 + Python 2.7 and later EDMC + Python 3.7. [Here's](https://python-future.org/compatible_idioms.html) a guide on writing Python 2/3 compatible code and [here's](https://github.com/Marginal/HabZone/commit/3c41cd41d5ad81ef36aab40e967e3baf77b4bd06) an example of the changes required for a simple plugin. From 8262a2afbac5d21c0b8a2c5a155adf7ff20a1917 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Sat, 20 Jun 2020 12:18:58 +0100 Subject: [PATCH 2/3] Attempts to fix the 'python3' branch URL in migration guide --- PLUGINS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PLUGINS.md b/PLUGINS.md index 6f3fdd02..95da995d 100644 --- a/PLUGINS.md +++ b/PLUGINS.md @@ -281,7 +281,7 @@ Disabled and enabled plugins are listed on the "Plugins" Settings tab # Migration to Python 3.7 -In a future release EDMC will use Python **3.7**, instead of the Python 2.7 it has historically used. As of mid-2020 there is a [python3 branch](/EDCD/EDMarketConnector/tree/python3) to test migrated plugins against. This is a brief outline of the steps required to migrate a plugin from earlier versions of EDMC: +In a future release EDMC will use Python **3.7**, instead of the Python 2.7 it has historically used. As of mid-2020 there is a [python3 branch](/tree/python3) to test migrated plugins against. This is a brief outline of the steps required to migrate a plugin from earlier versions of EDMC: - Rename the function `plugin_start` to `plugin_start3(plugin_dir)`. Plugins without a `plugin_start3` function will be listed as disabled on EDMC's "Plugins" tab and a message like "plugin SuperSpaceHelper needs migrating" will appear in the log. - Check that callback functions `plugin_prefs`, `prefs_changed`, `journal_entry`, `dashboard_entry` and `cmdr_data` if used are declared with the correct number of arguments. Older versions of this app were tolerant of missing arguments in these function declarations. From a8631e5bb87740a64bb9d0853831e732af222f25 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Sat, 20 Jun 2020 12:20:32 +0100 Subject: [PATCH 3/3] Gives up and uses full URL for python3 branch --- PLUGINS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PLUGINS.md b/PLUGINS.md index 95da995d..ae37e7a2 100644 --- a/PLUGINS.md +++ b/PLUGINS.md @@ -281,7 +281,7 @@ Disabled and enabled plugins are listed on the "Plugins" Settings tab # Migration to Python 3.7 -In a future release EDMC will use Python **3.7**, instead of the Python 2.7 it has historically used. As of mid-2020 there is a [python3 branch](/tree/python3) to test migrated plugins against. This is a brief outline of the steps required to migrate a plugin from earlier versions of EDMC: +In a future release EDMC will use Python **3.7**, instead of the Python 2.7 it has historically used. As of mid-2020 there is a [python3 branch](https://github.com/EDCD/EDMarketConnector/tree/python3) to test migrated plugins against. This is a brief outline of the steps required to migrate a plugin from earlier versions of EDMC: - Rename the function `plugin_start` to `plugin_start3(plugin_dir)`. Plugins without a `plugin_start3` function will be listed as disabled on EDMC's "Plugins" tab and a message like "plugin SuperSpaceHelper needs migrating" will appear in the log. - Check that callback functions `plugin_prefs`, `prefs_changed`, `journal_entry`, `dashboard_entry` and `cmdr_data` if used are declared with the correct number of arguments. Older versions of this app were tolerant of missing arguments in these function declarations.