Well git does have a progress percentage indicator, hopefully I can expose that.
Can you elaborate on what other possibilities you see can be done via headless ?
Well git does have a progress percentage indicator, hopefully I can expose that.
Basically auto-updates via a CRON job.
Could this be used on any of the addons ?sgrogan wrote: I think something like this, from FreeCAD python console, should work?EDIT: no restart required PY3.4+Code: Select all
import git repo = git.Repo(FreeCAD.getUserAppDataDir()+'/Mod/FCGear') repo.git.pull('origin','develop') repo.git.checkout('develop') import importlib importlib.reload(pygears)
I haven't found time to test.
@Joel_graff do you know about this?Joel_graff wrote:
Code: Select all
1 - list all installed addons
2 - list all installed addons that have updates
3 - exit
Choose:
Not really. Looks neat, though.
I don't think this is a priority.
Code: Select all
workbenches = list_workbenches(repo)
status = install_workbench(workbenches["Something"], "install")
Code: Select all
start
List official available Addons:
x 3D_Printing_Tools -> https://github.com/mark1791/3D_Printing_Tools
x A2plus -> https://github.com/kbwbe/A2plus
x AirPlaneDesign -> https://github.com/FredsFactory/FreeCAD_AirPlaneDesign
x animation -> https://github.com/microelly2/Animation
x ArchTextures -> https://github.com/furti/FreeCAD-ArchTextures
x assembly2 -> https://github.com/hamish2014/FreeCAD_assembly2
x Assembly4 -> https://github.com/Zolko-123/FreeCAD_Assembly4
x Autoload -> https://github.com/triplus/Autoload
x BCFPlugin -> https://github.com/podestplatz/BCF-Plugin-FreeCAD
+ BIM -> https://github.com/yorikvanhavre/BIM_Workbench
x BIMBots -> https://github.com/opensourceBIM/BIMbots-FreeCAD
x BOLTSFC -> https://github.com/boltsparts/BOLTSFC
x CADExchanger -> https://github.com/yorikvanhavre/CADExchanger
x cadquery_module -> https://github.com/jmwright/cadquery-freecad-module
x Cfd -> https://github.com/qingfengxia/Cfd
x CfdOF -> https://github.com/jaheyns/CfdOF
x CommandPanel -> https://github.com/triplus/CommandPanel
x cura_engine -> https://github.com/cblt2l/FreeCAD-CuraEngine-Plugin
x CurvedShapes -> https://github.com/chbergmann/CurvedShapesWorkbench
x Curves -> https://github.com/tomate44/CurvesWB
x Defeaturing -> https://github.com/easyw/Defeaturing_WB
x DesignSPHysics -> https://github.com/DualSPHysics/DesignSPHysics
+ dodo -> https://github.com/oddtopus/dodo
x drawing_dimensioning -> https://github.com/hamish2014/FreeCAD_drawing_dimensioning
x dxf_library -> https://github.com/yorikvanhavre/Draft-dxf-importer
x DynamicData -> https://github.com/mwganson/DynamicData
x EM -> https://github.com/ediloren/EM-Workbench-for-FreeCAD
x ExplodedAssembly -> https://github.com/JMG1/ExplodedAssembly
x fasteners -> https://github.com/shaise/FreeCAD_FastenersWB
x FCGear -> https://github.com/looooo/FCGear
x flamingo -> https://github.com/oddtopus/flamingo
x frame -> https://github.com/looooo/freecad_frame
x GDT -> https://github.com/juanvanyo/FreeCAD-GDT
x geodata -> https://github.com/microelly2/geodata
x Geomatics -> https://github.com/HakanSeven12/FreeCAD-Geomatics-Workbench
x Glass -> https://github.com/triplus/Glass
+ IconThemes -> https://github.com/triplus/IconThemes
x InventorLoader -> https://github.com/jmplonka/InventorLoader
x kerkythea -> https://github.com/marmni/FreeCAD-Kerkythea
x kicadStepUpMod -> https://github.com/easyw/kicadStepUpMod
x lattice2 -> https://github.com/DeepSOIC/Lattice2
x Launcher -> https://github.com/triplus/Launcher
x LCInterlocking -> https://github.com/execuc/LCInterlocking
x Lithophane -> https://github.com/furti/FreeCAD-Lithophane
x Manipulator -> https://github.com/easyw/Manipulator
x MeshRemodel -> https://github.com/mwganson/MeshRemodel
x MOOC -> https://github.com/wood-galaxy/mooc-workbench
x NavigationIndicator -> https://github.com/triplus/NavigationIndicator
x nurbs -> https://github.com/microelly2/freecad-nurbs
x Part-o-magic -> https://github.com/DeepSOIC/Part-o-magic
x parts_library -> https://github.com/FreeCAD/FreeCAD-library
x pcb -> https://github.com/marmni/FreeCAD-PCB
x persistenttoolbars -> https://github.com/triplus/PersistentToolbars
x PieMenu -> https://github.com/triplus/PieMenu
x Plot -> https://github.com/FreeCAD/freecad.plot
x pluginloader -> https://github.com/microelly2/freecad-pluginloader
x pyrate -> https://github.com/mess42/pyrate
x reconstruction -> https://github.com/microelly2/reconstruction
+ Reinforcement -> https://github.com/amrit3701/FreeCAD-Reinforcement
x Render -> https://github.com/FreeCAD/FreeCAD-render
x Reporting -> https://github.com/furti/FreeCAD-Reporting
x retr3d -> https://github.com/Maaphoo/Retr3d
x SelectorToolbar -> https://github.com/triplus/SelectorToolbar
x sheetmetal -> https://github.com/shaise/FreeCAD_SheetMetal
x Ship -> https://github.com/FreeCAD/freecad.ship
x ShortCuts -> https://github.com/triplus/ShortCuts
x Silk -> https://github.com/edwardvmills/Silk
x slic3r-tools -> https://github.com/limikael/freecad-slic3r-tools
x SlopedPlanesMacro -> https://github.com/luzpaz/SlopedPlanesMacro
+ symbols_library -> https://github.com/FreeCAD/FreeCAD-symbols
x TabBar -> https://github.com/triplus/TabBar
x ThreadProfile -> https://github.com/mwganson/ThreadProfile
x timber -> https://github.com/wood-galaxy/FreeCAD-Timber
x ToolbarStyle -> https://github.com/triplus/ToolbarStyle
x WebTools -> https://github.com/yorikvanhavre/WebTools
x workfeature -> https://github.com/Rentlau/WorkFeature-WB
x workfeature-macro -> https://github.com/Rentlau/WorkFeature
x yaml-workspace -> https://github.com/Mambix/FreeCAD-yaml-workspace
Legend:
+ = Installed
X = Not Installed
middle
end
So I should test for command line parametersvocx wrote: ↑Thu Oct 24, 2019 3:13 am Better to make it work first by just passing the name of the workbench, and a command like "install", "update", "remove".
Code: Select all
Once you have this, then you can create a prompt or something like that. But the basic command should not have a prompt. A prompt won't let you automate things. A prompt is already a kind of GUI interface because it requires input from the user. So make sure the basic commands work with simple inputs and outputs.Code: Select all
workbenches = list_workbenches(repo) status = install_workbench(workbenches["Something"], "install")
Code: Select all
argv
Code: Select all
$ ./freecadcmd AddonManagerHeadless.py -h
list - list official workbenches (both installed and non-installed, if installed then which have updates)
update-all - update all workbenches that have updates
update <wb-name> - update specific workbench
add <wb-name> - add a workbench
remove <wb-name> - remove a workbench
Yes, that's a better approach. As I said, think of a way that it can do something by itself, just with the provided input. That will allow you to truly perform automatic tasks without user input.Kunda1 wrote: ↑Thu Oct 24, 2019 11:23 am ...
So I should test for command line parameters...Code: Select all
argv
Code: Select all
# This is a Python-based command
AddonManagerHeadless --repo https://something --install A2plus
Code: Select all
# This is a Python library
import AddonManagerHeadless as AM
repo = AM.set_repo("https://something")
AM.install(repo, "A2plus")
Code: Select all
import sys
import AddonManagerHeadless as AM
if sys.argv[1] == "--repo":
repo = AM.set_repo(argv[2])
if sys.argv[3] == "--install":
installed = AM.install(argv[4])