@@ -3,3 +3,83 @@ A plugin to provide information for Aries' Editorial Manager to enable automatic
33
44## Requirements
55This plugin depends on the Production Transporter plugin in order to work properly.
6+
7+ ## Development Tips
8+ This section contains guidance for developing this plugin.
9+
10+ For the purposes of this guide we'll refer to the Janeway installation folder as ` [workspace] ` .
11+
12+ The plugin's installation folder is assumed to be ` [workspace]/src/plugins/editorial_manager_transfer_service ` .
13+
14+ ### Adding The Janeway SRC to the ` PYTHONPATH `
15+ Adding the Janeway SRC folder to the ` PYTHONPATH ` can help any type of IDE correctly identify imports while developing plugins.
16+
17+ #### Instructions for Python Virtual Environment (VENV)
18+ First, open your ` activate ` file in a text editor. It is located at:
19+ ``` text
20+ [workspace]/.venv/bin/activate
21+ ```
22+ Once open, scroll to find the following text section:
23+ ``` bash
24+ VIRTUAL_ENV=" [workspace]/.venv"
25+ if ([ " $OSTYPE " = " cygwin" ] || [ " $OSTYPE " = " msys" ]) && $( command -v cygpath & > /dev/null) ; then
26+ VIRTUAL_ENV=$( cygpath -u " $VIRTUAL_ENV " )
27+ fi
28+ export VIRTUAL_ENV
29+
30+
31+ _OLD_VIRTUAL_PATH=" $PATH "
32+ PATH=" $VIRTUAL_ENV /bin:$PATH "
33+ export PATH
34+ ```
35+ Please note and change the ` [worksapce] ` variable to your Janeway installation path.
36+
37+ You will modify this section to become the following:
38+ ``` bash
39+ _PYTHON_ENV_PKG=' [workspace]'
40+ VIRTUAL_ENV=" $_PYTHON_ENV_PKG /.venv"
41+ if ([ " $OSTYPE " = " cygwin" ] || [ " $OSTYPE " = " msys" ]) && $( command -v cygpath & > /dev/null) ; then
42+ VIRTUAL_ENV=$( cygpath -u " $VIRTUAL_ENV " )
43+ fi
44+ export VIRTUAL_ENV
45+
46+ _OLD_VIRTUAL_PATH=" $PATH "
47+ PATH=" $VIRTUAL_ENV /bin:$PATH "
48+ export PATH
49+
50+ _OLD_VIRTUAL_PYTHONPATH=" $PYTHONPATH "
51+ PYTHONPATH=" $_PYTHON_ENV_PKG :$PYTHONPATH "
52+ export PYTHONPATH
53+ ```
54+ Next you will modify the ` deactivate() ` script. Scroll until you find this section of script:
55+ ``` bash
56+ deactivate () {
57+ unset -f pydoc > /dev/null 2>&1 || true
58+
59+ # reset old environment variables
60+ # ! [ -z ${VAR+_} ] returns true if VAR is declared at all
61+ if ! [ -z " ${_OLD_VIRTUAL_PATH: +_} " ] ; then
62+ PATH=" $_OLD_VIRTUAL_PATH "
63+ export PATH
64+ unset _OLD_VIRTUAL_PATH
65+ fi
66+ if ! [ -z " ${_OLD_VIRTUAL_PYTHONHOME+_} " ] ; then
67+ PYTHONHOME=" $_OLD_VIRTUAL_PYTHONHOME "
68+ export PYTHONHOME
69+ unset _OLD_VIRTUAL_PYTHONHOME
70+ fi
71+ ` ` `
72+ Modify it to add the ` PYTHONPATH` deactivation:
73+ ` ` ` bash
74+ ...
75+ unset _OLD_VIRTUAL_PATH
76+ fi
77+ if ! [ -z " ${_OLD_VIRTUAL_PYTHONPATH: +_} " ] ; then
78+ PYTHONPATH=" $_OLD_VIRTUAL_PYTHONPATH "
79+ export PYTHONPATH
80+ unset _OLD_VIRTUAL_PYTHONPATH
81+ fi
82+ if ! [ -z " ${_OLD_VIRTUAL_PYTHONHOME+_} " ] ; then
83+ ...
84+ ` ` `
85+ After restarting your IDE, you should see it properly detect the SRC folder.
0 commit comments