Where is the documentation for creating plugin repositories?
I've created a set of plugins for analyzing neuron connectivity in Tulip. Deploying the plugins is hard though. Right now I have my users download the source files and copy them by hand to the tulip plugin directory. This is error-prone and it's hard to fix bugs or add features in the plugins because users are reluctant to upgrade plugin source.
My goal is for users to install plugins from inside Tulip. It seems like creating a plugin repository would acheive this.
Thanks,
Ethan
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Current official Tulip plugins repositories are hosted at the LaBRI in Bordeaux
and are dedicated to the distribution of precompiled C++ plugins for MacOs and Windows platform considered in a 'testing' state (i.e. not considered stable). Python plugins are currently not handled by it. I agree that it would be an interesting feature for the next Tulip release, I will try to think about it when I will have some time.
Nevertheless, you can still obtain what you want by using the Python startup hook scripts mechanism offered by Tulip-Python, assuming your plugins code is hosted on GitHub. Copy the following Python script in a .py file inside the following folder: <home_dir>/.TulipX-Y/python/startup and each time Tulip starts, the code of the plugins will be downloaded and then each of them will be registered in the Tulip plugin database.
So your users will now have to copy a single file for retrieving and updating the plugins
instead of multiple ones.
importsite,sys,os,tempfile,logging,tempfile,zipfilefromtulipimporttlpdefdownload_file(url,desc=None):ifsys.version_info>=(3,):importurllib.requestasurllib2importurllib.parseasurlparseelse:importurllib2importurlparseu=urllib2.urlopen(url)scheme,netloc,path,query,fragment=urlparse.urlsplit(url)filename=os.path.basename(path)filename=os.path.join(desc,filename)withopen(filename,'wb')asf:f.write(u.read())returnfilename# create a temporary directorytmpDir=tempfile.mkdtemp()# download master branch in a zip file from a GitHub repository# and save it in the temp dirurl="https://github.com/anlambert/tulip_python_plugins/archive/master.zip"filename=download_file(url,tmpDir)# extract the archive content in the temp dirzip_ref=zipfile.ZipFile(filename,'r')zip_ref.extractall(tmpDir)zip_ref.close()# load Tulip Python plugins recursively from the temp dirtlp.loadPluginsFromDir(tmpDir)
Hope that it will help.
Antoine
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi-
Where is the documentation for creating plugin repositories?
I've created a set of plugins for analyzing neuron connectivity in Tulip. Deploying the plugins is hard though. Right now I have my users download the source files and copy them by hand to the tulip plugin directory. This is error-prone and it's hard to fix bugs or add features in the plugins because users are reluctant to upgrade plugin source.
My goal is for users to install plugins from inside Tulip. It seems like creating a plugin repository would acheive this.
Thanks,
Ethan
Hi Ethan,
Current official Tulip plugins repositories are hosted at the LaBRI in Bordeaux
and are dedicated to the distribution of precompiled C++ plugins for MacOs and Windows platform considered in a 'testing' state (i.e. not considered stable). Python plugins are currently not handled by it. I agree that it would be an interesting feature for the next Tulip release, I will try to think about it when I will have some time.
Nevertheless, you can still obtain what you want by using the Python startup hook scripts mechanism offered by Tulip-Python, assuming your plugins code is hosted on GitHub. Copy the following Python script in a .py file inside the following folder: <home_dir>/.TulipX-Y/python/startup and each time Tulip starts, the code of the plugins will be downloaded and then each of them will be registered in the Tulip plugin database.
So your users will now have to copy a single file for retrieving and updating the plugins
instead of multiple ones.
Hope that it will help.
Antoine
Ok. That's a clever trick--using the python script to automatically download the plugins. I will give it a try. Thanks.