Plugin Loader

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Post Reply
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Plugin Loader

Post by microelly2 »

bn_634.png
bn_634.png (16.52 KiB) Viewed 14674 times
The use of a makefile and git may be not always the easiest way for endusers of FreeCAD
to add current versions of extra software to their official installation.

I have started to beautify my installer to make it usable by the community.
Its not a big thing but comfortable to have selected software up to date.

this is the first version (still for linux) http://youtu.be/O89SkZh36Xg

The ideas:

The configuration of the plugin loader is a local file
and maintained by the end user
It is in a simple syntax (yaml). The yaml Parser is part of the libpack
and can so be used for this.


For each software package there is a description
with name, internet-soure, local destination directory and all information we later need too (checksum, dependencies etc. ). yaml is very powerful to map such requirements.

All these Packages can be selected in a GUI and installed/replaced on the local machine.
If there will be a common understanding of version numbering
the process can become automated too
(may be to read the last commit of the git-masterbranch or use a special timestamp file)

Please let me know what you think about the idea
and what conventions should be pay attention to.

What must be discussed:
Where to store addons
namespace conventions
version numbering
..?

the script: https://github.com/microelly2/freecad-pluginloader
Attachments
bn_635.png
bn_635.png (64.25 KiB) Viewed 14674 times
User avatar
dubstar-04
Posts: 698
Joined: Mon Mar 04, 2013 8:41 pm
Location: Chester, UK
Contact:

Re: Plugin Loader

Post by dubstar-04 »

This is a great idea, I really like what Kodi (xbmc) did with the add-on architecture allowing binary addons too.

http://kodi.wiki/view/Add-on_manager
User avatar
yorik
Founder
Posts: 13630
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Plugin Loader

Post by yorik »

Excellent, microelly! This is simple and efficient... What is the use of the "plugins" folder? I mean why not install them directly in the "Mod" folder? Is it so you can keep versions?

What I would change in your script:

- change your hard-coded '/usr/lib/freecad/...' with FreeCAD.ConfigGet("UserAppData"), this would allow the script to work on non-linux platforms, and also doesn't require admin permissions
- add a button or a link next to each plugin, that sends to a web page (the github repo?), so the user can learn what the plugin does

Later on, this could also be extended to install big macros such as WorkPlane... Very good!
User avatar
saso
Veteran
Posts: 1920
Joined: Fri May 16, 2014 1:14 pm
Contact:

Re: Plugin Loader

Post by saso »

This indeed already looks quite nice!

I was also thinking a bit more about it since our last discussion and personally I think I would go to sort of design it in the way the linux update system usually works. There is a list of repositories, in our case this could be the github links, we could have a few of the popular there by default and users could add more on there own. And then things would simply get installed and updated from it.

Personally I would prefer that at least at the beginning nothing would be done automatically, so that user would have to enable an "repository" before the fist install and then confirm before installing each update.

And I guess same as on linux we could also have it work from gui and from console. There is probably even the possibility to add some type of certification / signing for integrity control (remember ed25519.py in our discussion on bugticket about debian dxf files download?) :)
Last edited by saso on Wed Apr 15, 2015 4:03 pm, edited 4 times in total.
User avatar
saso
Veteran
Posts: 1920
Joined: Fri May 16, 2014 1:14 pm
Contact:

Re: Plugin Loader

Post by saso »

yorik wrote:What is the use of the "plugins" folder? I mean why not install them directly in the "Mod" folder?
On newer versions of Windows this would probably need administrator rights, since it is under the ..\Program Files folder, while writing things under ..\User does not.
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Plugin Loader

Post by microelly2 »

Thank you all for the comments. I have used the week to add some (I hope) useful details: Menu bar integration, more freedom for the destination directory

The plugin folder is only a working concept where to place programs.
Workbenches can be placed into the global or local Mod Folder.

My idea is to have for every plugin a separate directory. Macros can be mapped this way: myMacroy.FCmacro --> plugins/myMacro/myMacro.py
complex Macros like the Workfeature Macro will get their own space plugin/Workfeature with all files and subdir structure

The changelog/commit log date can be used to descide where an update is requiered.
The display of additional information is no technical problem, some attributes are already defined author, descrition, infom, history
It is possible to add menu entries to get the module run (if its not a workbench with its own menu and toolbars)

open problems/todos:
how to automatic initialize the plugin manager (create the menubar entry on startup) the Mod/Init.py cannot be used because the FreeCADGui seems not to be accessable at the time, when this file is executed. :?
naming conventions
port to windows - I can do it
port to mac
add macro support

demo: https://youtu.be/Xf4tDGO6pbg
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Plugin Loader

Post by microelly2 »

The plugin installer can now install the well known extensions:

bolts library,
workfeature macro,
drawing dim workbench and
assembly2 workbench
drawing symbol library
exploded Assembly Animation workbench

There are still some (I hope small and solvable) problems with updating the menu bar

https://youtu.be/2ysYy_ihoq0

for windows and macos the yaml file must be modified and should work too.
the parts library needs only a small modification

macros which are stored in zip form can be integrated, but still no idea to integrate the plain text embedded macros from
http://www.freecadweb.org/wiki/index.ph ... os_recipes :?
User avatar
yorik
Founder
Posts: 13630
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Plugin Loader

Post by yorik »

Excellent work microelly!
Indeed integrating macros could be a bit of work, but it might be a good opportunity to do something better than the current wiki page. Maybe start a github macros repository?
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Plugin Loader

Post by microelly2 »

yorik wrote: Maybe start a github macros repository?
Yes, I think its a good idea to have some conventions and version control.
I have started to integrate the next macros, so i can see what all can happen.
User avatar
yorik
Founder
Posts: 13630
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Plugin Loader

Post by yorik »

Okay, I started a repo: https://github.com/FreeCAD/FreeCAD-macros
I'll copy/paste a couple of macros from the wiki so we can test...
Post Reply