OK, I got your example plugin working. Looks good!
It took a bit of doing to clone your SIP updates:
and then manually install the plugin files.
By the way, there was a recent pull request that added some changes to the sip_service.sh script in the SIP folder. It sets up a Python virtual environment and modifies the sip.service to run sip.py using the Python interpreter from the venv. This allows plugins to install dependencies without errors.
I added some code to your diurnal_display.py plugin file:
This also requires adding "import subprocess" to the standard library imports.
With this code your plugin installs the required suncalc module on the first run without any user action.
To get this to work you will need to disable any existing system_d sip service:
and then run the script from the SIP folder:
then reboot.
It took a bit of doing to clone your SIP updates:
Code:
git clone https://github.com/jonathan-marsh/SIP.git
and then manually install the plugin files.
By the way, there was a recent pull request that added some changes to the sip_service.sh script in the SIP folder. It sets up a Python virtual environment and modifies the sip.service to run sip.py using the Python interpreter from the venv. This allows plugins to install dependencies without errors.
I added some code to your diurnal_display.py plugin file:
Code:
try:
from suncalc import get_times
except ModuleNotFoundError:
command = "pip install suncalc"
subprocess.call(command.split())
from suncalc import get_times
This also requires adding "import subprocess" to the standard library imports.
With this code your plugin installs the required suncalc module on the first run without any user action.
To get this to work you will need to disable any existing system_d sip service:
Code:
systemctl disable sip
Code:
bash sip_service.sh
<p><br></p>