How to run Addon Manager in Headless mode?
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: How to run Addon Manager in Headless mode?
Just a note that there is a very detailed section about Reloading Python modules in order to circumvent FC restart in
https://forum.freecadweb.org/viewtopic.php?f=10&t=35383
https://forum.freecadweb.org/viewtopic.php?f=10&t=35383
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Re: How to run Addon Manager in Headless mode?
The current incarnation of the code: https://gist.github.com/luzpaz/f3bfaaef ... 941f6ed7a5 (Revision 15)
You can git clone it by:
Code: Select all
$ git clone https://gist.github.com/f3bfaaef8aaec9c66b96e0941f6ed7a5.git AddonManagerHeadless.py
$ freecadcmd AddonManagerHeadless.py
Usage:
Code: Select all
CLI Addon Manager
Usage:
list lists all official addons + which are currently installed
check check what addons have Updates
updateall update all addons that have pending updates
install <addon> [<addon>] installs valid (case-sensitive) addons
remove <addon> [<addon>] remove valid (case-sensitive) addons
- list - ListRepo()
- check - ListRepo() + CheckUpdateRepo()
- updateall - ListRepo() + CheckUpdateRepo() + UpdateRepo()
- install - ListRepo() + CheckRequested() + InstallRepo()
- remove - RemoveRepo()
Status
Currently the list and check functionalities work (but check actually may be updating as well, which it shouldn't) but I'd like to refine them so that if someone wants to mute the output the can use a flag to do so. Also I'd like to list the columns alphabetically from top to bottom instead of across.
updateall and install aren't functioning correctly, I broke them fiddling with the gitpython module tweaks trying output the progress bar of a git pull to print to STDOUT. In fact, I don't think the script is installing the Addons correctly anymore because when I want to rollback a commit in one of the addons for testing purposes I get an unexpected output when I run git status showing that there is no different between local and upstream. See https://forum.freecadweb.org/viewtopic. ... 40#p343692
remove works but isn't correctly removing addons since they also require removal from user.cfg so that needs to be done at some point as well by figuring out what the uninstall parameters are and executing them through the script.
I'd also like to follow @vocx's advice and turn this script in to an importable module (https://forum.freecadweb.org/viewtopic. ... 10#p342917)
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Re: How to run Addon Manager in Headless mode?
For my clear understanding : is that coded from scratch or do you modify the existing GUI manager?
Also have you identified some priorities in the todos?
I'll have a look ASAP but unfortunately can't promise any deadline ATM.
Also have you identified some priorities in the todos?
I'll have a look ASAP but unfortunately can't promise any deadline ATM.
Re: How to run Addon Manager in Headless mode?
Modified the existing GUI manager, basically cut and pasted most of the following: AddonManager.py
and
addonmanager_workers.py
just removed all the Qt code and some other extraneous code
https://github.com/FreeCAD/FreeCAD/tree ... donManager
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Re: How to run Addon Manager in Headless mode?
The Todos listed in the script are later down the roadmap. Most importantly is:
- the check, udateall, install, and remove linked functions need to be fixed.
- the sys.argv[] method is inferior because currently it hardcodes argv[3] and above as command line variables, which is wrong here's the usecase:
The script currently assumes this will be the input
./AppRun -c ../AddonManagerHeadless.py
where in reality it will be
freecadcmd AddonManagerHeadless.py
or
./AppRun -c -M /usr/lib/python3.7/site-packages ../AddonManagerHeadless.py
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Re: How to run Addon Manager in Headless mode?
Not had much time to devote to this. Hopefully soon. If anyone wants to jump in, feel free to.
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Re: How to run Addon Manager in Headless mode?
Still thinking about this but don't have structured time to sit down and complete this for a while. Anyone interested in doing so?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Re: How to run Addon Manager in Headless mode?
Hello, I just worked on Addon Manager to cofigure proxy setting.
Improving this module is pleasant, so I can continue your work
I just have difficulties to know what are next officials objectives for the devellopment of the whole module.
Is there a discussions somewhere in the forum or elsewhere?
EDIT : In fact, I already know this topic, so I will ask there : https://forum.freecadweb.org/viewtopic. ... 4&start=50
Improving this module is pleasant, so I can continue your work
I just have difficulties to know what are next officials objectives for the devellopment of the whole module.
Is there a discussions somewhere in the forum or elsewhere?
EDIT : In fact, I already know this topic, so I will ask there : https://forum.freecadweb.org/viewtopic. ... 4&start=50
Re: How to run Addon Manager in Headless mode?
There aren't any official objectives that I know of. Basically, whatever you can improve is good.
In my first post in this thread I mention the difficulties of achieving what Kunda wants. The code is currently run from a GUI point of view. It would be nice if you could decouple the GUI part from the basic GUI-less actions. This is the way the Draft workbench is structured.
The Draft Workbench defines all functions in Draft.py, while the GUI tools are defined in DraftTools.py.
So, to achieve what Kunda wants, you could write basic functions that don't need the GUI, and call them from the GUI class CommandAddonManager.
If this is done, then you don't need to launch the entire FreeCAD interface to update or install packages, you could do it from a script.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
Re: How to run Addon Manager in Headless mode?
It seems to be like you said It is good to be in an open mind project.
To open the discussion,I have presented my intentions and asked opinion in the dedicaded post.
Got it. I understand well this kind of structure cause I already have developped research instrument driver with a frontend (GUI, button and graph) and a backend (communication, drive control, log, data acquisition and calculation)