mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-17 17:42:20 +03:00
Update PLUGINS.md (#184)
This commit is contained in:
parent
890c2de639
commit
1ca13a85e1
20
PLUGINS.md
20
PLUGINS.md
@ -123,3 +123,23 @@ To package your plugin for distribution simply create a `.zip` archive of your p
|
|||||||
|
|
||||||
* Windows: In Explorer right click on your plugin's folder and choose Send to → Compressed (zipped) folder.
|
* Windows: In Explorer right click on your plugin's folder and choose Send to → Compressed (zipped) folder.
|
||||||
* Mac: In Finder right click on your plugin's folder and choose Compress.
|
* Mac: In Finder right click on your plugin's folder and choose Compress.
|
||||||
|
|
||||||
|
If there are any external dependecies, for example paho.mqtt, you have to bundle
|
||||||
|
any within the plugin folder and make sure it can be included from there.
|
||||||
|
|
||||||
|
Example in top of load.py add
|
||||||
|
```python
|
||||||
|
import sys
|
||||||
|
import os
|
||||||
|
try:
|
||||||
|
import paho.mqtt.client as mqtt
|
||||||
|
except:
|
||||||
|
print 'failed to load'
|
||||||
|
#add current folder to path
|
||||||
|
#dependencies should be included within
|
||||||
|
sys.path.append(os.path.join(os.path.dirname(__file__)))
|
||||||
|
#import again
|
||||||
|
import paho.mqtt.client as mqtt
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user