Page 1 of 1

how to publish the plugin written in Script Manager

PostPosted: Mon Apr 03, 2017 6:00 pm
by emergency_rose
I've developed a plugin written in jython using Mango Script Manager, now I want to publish this plugin so that people can use it, but do I simply offer the script so that people can download and import, or I should compress it to a .jar file?
Ps. there are also other external packages for this plugin.

Re: how to publish the plugin written in Script Manager

PostPosted: Tue Apr 04, 2017 4:43 pm
by admin
Right now there isn't a way to import a script as a JAR, so I think you would just need to publish the script text or a compressed file with all the components and perhaps a README. You are welcome to publish it here.

I'd be very interested to see how you incorporated external packages. A number of people have asked about this in the past. It would be nice to be able to point to your example if it comes up again.

Re: how to publish the plugin written in Script Manager

PostPosted: Fri Apr 07, 2017 4:12 pm
by emergency_rose
Thank you! I'm not sure if you are asking how to import external package for jython in script manager. If so, I can post my method.

All the external package that can be used for jython should be .jar format. Then just use sys.path.append to add the package path. After that, you can import the class as in python. For example:

Code: Select all
import sys
import Numeric as np

What should be pointed out is that if the class you want to import is not directly under the .jar file(as you can check after opening the .jar package), you should add the folder that contain the class to the path, too. You can either try import package.subfolder.class, or use sys.addpackage. Actually I can't remember clearly, but this way should work.

In linux system, I would like to offer the whole software package which includes both the mango software and my plugin, since the bash script needs to be changed. Also, in this way, people can directly use the plugin without additional operation except for the importing.

In OS X system, I haven't found an appropriate way to pack my plugin into the pkg file (although I think it should not be so difficult, I just need more time). But I can change the plist file then repack it to installable pkg.

Hope it will help.