Add ons manager - development and bugs topic

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
User avatar
mnesarco
Posts: 92
Joined: Thu Mar 26, 2020 8:52 pm

Re: Add ons manager - development and bugs topic

Postby mnesarco » Tue May 19, 2020 3:06 am

I have tested with metadata.txt retrieval.... only 4 of all Workbenches in FreeCAD-Addons hava a metadata.txt file. It is a high cost for only 4 positive results. So I will keep this option deactivated by now.
User avatar
mnesarco
Posts: 92
Joined: Thu Mar 26, 2020 8:52 pm

Re: Add ons manager - development and bugs topic

Postby mnesarco » Tue May 19, 2020 4:28 pm

Hi Friends,
I have an idea, what if we maintain an index file in the root of https://github.com/FreeCAD/FreeCAD-addons ?

Currently, i obtain the workbench list from https://github.com/FreeCAD/FreeCAD-addo ... gitmodules this file is maintained by git automatically when there are submodules. But it contains only the url of the external repo and the local path of the module.

What if we put our own index file, something like index.ini:

Code: Select all

[assembly2]
title=Assembly2
description=Old assembly extension
repository=https://github.com/hamish2014/FreeCAD_assembly2.git
icon=https://raw.githubusercontent.com/hamish2014/FreeCAD_assembly2/master/Gui/Resources/icons/workBenchIcon.svg
flags=obsolete

[drawing_dimensioning]
title=...
description=...
repository=...
icon=...
flags=...

....


I can generate this file for the first time, and it will need very low maintenance.

By this way i can try to obtain the list form index.ini first, and if not found (in case of other sources), fallback to .gitmodules.

What do you think?
User avatar
mnesarco
Posts: 92
Joined: Thu Mar 26, 2020 8:52 pm

Re: Add ons manager - development and bugs topic

Postby mnesarco » Tue May 19, 2020 4:47 pm

OMG! I have just discovered this: https://wiki.freecadweb.org/External_workbenches

Should i use this page as the trusted source of the Workbenches list? if it is the case, i can get everything from there very efficiently. and use index.ini approach only from external (not https://github.com/FreeCAD/FreeCAD-addons) sources.
User avatar
mnesarco
Posts: 92
Joined: Thu Mar 26, 2020 8:52 pm

Re: Add ons manager - development and bugs topic

Postby mnesarco » Tue May 19, 2020 4:55 pm

WOW! there is another better index: https://wiki.freecadweb.org/External_workbench_list
User avatar
yorik
Site Admin
Posts: 11845
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: Add ons manager - development and bugs topic

Postby yorik » Tue May 19, 2020 5:03 pm

Awesome work @rnesarco! I

would advise for LGPL2+ license (it's lgpl2 license with a line that says "or, at your option, a latter version") that makes it possible for users to use it as it was lgpl3. I think that would remove most headache license in the future... it is the same we use in freecad.

I would also put as less requirements as possible for workbenches, because wee want as much activity there and make it easy for developers ;)

For the problem of loading readme files, i would still use that as much as possible, even with a slight delay, because it's the most likely (only?) place the developer will keep up to date.. also some addons might have a help page on our wiki.. but some in other location like the github wiki. the addon dev should inform that in some way...

Remenmber that the addons list from our wiki might notalways be up to date.. it is made manually
User avatar
mnesarco
Posts: 92
Joined: Thu Mar 26, 2020 8:52 pm

Re: Add ons manager - development and bugs topic

Postby mnesarco » Tue May 19, 2020 5:12 pm

yorik wrote:
Tue May 19, 2020 5:03 pm
For the problem of loading readme files, i would still use that as much as possible, even with a slight delay, because it's the most likely (only?) place the developer will keep up to date.. also some addons might have a help page on our wiki.. but some in other location like the github wiki. the addon dev should inform that in some way...
There is not problem loading README files, it is already done. The user have access to Full README by clicking readme. The problem i am trying to solve is to get the a small description to show in the list along with the Addon Name. Macros already have description. But i think the solution is simple now:

1. I will list all workbenches from .gitmodules (it requires zero maintenance)
2. I will get descriptions from https://wiki.freecadweb.org/External_workbenches, if the workbench is not listed, no description, so the user must click readme to see more.
User avatar
mnesarco
Posts: 92
Joined: Thu Mar 26, 2020 8:52 pm

Re: Add ons manager - development and bugs topic

Postby mnesarco » Tue May 19, 2020 10:35 pm

So far so good, now workbenches lists also show useful descriptions and are automatically classified in categories. And it is very fast.

Selection_117.png
Selection_117.png (148.01 KiB) Viewed 158 times

During this process I discovered some errors in the wiki page (https://wiki.freecadweb.org/External_workbench_list), some workbenches in the list are pointing to wrong repositories, see attached list. I don't have write access to the wiki, so maybe one of you can fix it. in the attached file I show what to fix.

wikierrors.txt
(3.45 KiB) Downloaded 2 times
vocx
Posts: 3974
Joined: Thu Oct 18, 2018 9:18 pm

Re: Add ons manager - development and bugs topic

Postby vocx » Wed May 20, 2020 3:57 pm

mnesarco wrote:
Tue May 19, 2020 4:55 pm
WOW! there is another better index: https://wiki.freecadweb.org/External_workbench_list
Read this for more background: 2 wiki for external workbenches

I am trying to streamline the process of adding workbenches to the addon manager, but it is a difficult task because until now workbench developers didn't care too much about providing metadata for their code.

My idea is that External workbenches should list every workbench, while External workbench list contains only those that are actually available in the Addon Manager.
Always add the important information to your posts if you need help.
To support the documentation effort, and code development, your donation is appreciated: paypal.
vocx
Posts: 3974
Joined: Thu Oct 18, 2018 9:18 pm

Re: Add ons manager - development and bugs topic

Postby vocx » Wed May 20, 2020 4:04 pm

mnesarco wrote:
A new request: choose installation directory for the workbench.

Normally workbenches must be in the .FreeCAD/Mod/ directory so that they are loaded automatically on starting up the program.

However, it is possible to have the workbench anywhere else. Then you can use a command line option to point FreeCAD to an additional module directory.

Code: Select all

freecad -M new/directory/Mod
See Any Location option of installed AddonManager workbench.

So, the Addon Manager could download the workbench to a specific directory, but warn the user that he or she needs to enter the appropriate option at startup.

See Start_up_and_Configuration.
Always add the important information to your posts if you need help.
To support the documentation effort, and code development, your donation is appreciated: paypal.
User avatar
mnesarco
Posts: 92
Joined: Thu Mar 26, 2020 8:52 pm

Re: Add ons manager - development and bugs topic

Postby mnesarco » Thu May 21, 2020 7:33 pm

Hi Friends,

I Have an ALPHA version for testing. It is far from finished, but getting some feedback at this point is very valuable.

1. Developed in Python3 without any Python2 compatibility
2. Tested only on FreeCAD 0.19 on Linux (Once I complete base requirements, I will do proper testing on other platforms)
3. Code is clear but needs more documentation
4. QT5 only
5. There are many pending things like: UpdateCheck daemon, Uninstall Package, Different Install roots, and more security checks

Currently there is no strict specification for Addon layouts, for example there is no naming convention about Workbench class name. So i do some ugly tricks to find it... things like that.

Packages not installed with this Manager are discovered but lack enough metadata, so they cannot be updated directly from the installed List. But the user can update them from the Cloud package list and it will be upgraded.

If you found something incredibly stupid in the code, please tell me, I will be happy to make it better. I have not too much experience with python idioms.

It was designed to be a Workbench and it saves some cache files inside addon_root/Resources/cache (inside user's Mod dir). but if it will be included in FreeCAD as a core package i will need to change the cache path to something inside User's application data explicitly.

https://github.com/mnesarco/FreeCAD_ExtMan

I hope you like it.