Run an in-memory macro as if run by MacroManager

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

Re: Run an in-memory macro as if run by MacroManager

Post by TheMarkster »

Does it also fail on linux and mac? It fails for me on 0.19 and 0.20 in windows, but not with an older version (0.18 py2/qt4 build) and not on 0.20 running inside a virtual machine (ubuntu guest running on a windows 10 host). Does the application itself have a certificate that needs to be updated?
heda
Veteran
Posts: 1348
Joined: Sat Dec 12, 2015 5:49 pm

Re: Run an in-memory macro as if run by MacroManager

Post by heda »

chennes wrote: Tue Oct 26, 2021 1:45 am the code that gets pulled off the wiki via a crazy html-parsing routine.
have formed a vague idea around that (not put into action),
for whatever reason that html generator is clipping the "source code" in the template, that could be worked around by not looking at the html page of the wiki, but rather go to an address like https://wiki.freecadweb.org/index.php?t ... emplates=1 which opens up for getting the full version of the macro from the wiki regardless if it is capped or not in the html. would probably simplify parsing as well - have not looked at it, but suppose it is regexp which if in python is slow...
chrisb
Veteran
Posts: 53920
Joined: Tue Mar 17, 2015 9:14 am

Re: Run an in-memory macro as if run by MacroManager

Post by chrisb »

TheMarkster wrote: Tue Oct 26, 2021 3:53 pm Does it also fail on linux and mac?
I admit that I didn't follow this topic. What exactly can/should I test?
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

Re: Run an in-memory macro as if run by MacroManager

Post by TheMarkster »

chrisb wrote: Tue Oct 26, 2021 7:19 pm
TheMarkster wrote: Tue Oct 26, 2021 3:53 pm Does it also fail on linux and mac?
I admit that I didn't follow this topic. What exactly can/should I test?
Addon manager fails to get the list of macros from the wiki. It gets the git repo macros, but not the wiki. It works in my ubuntu virtual machine (ubuntu guest / windows host) and in windows if I use 0.18 py2/qt4 build.
chrisb
Veteran
Posts: 53920
Joined: Tue Mar 17, 2015 9:14 am

Re: Run an in-memory macro as if run by MacroManager

Post by chrisb »

TheMarkster wrote: Tue Oct 26, 2021 8:01 pm It gets the git repo macros, but not the wiki.
Works here, but I have GitPython installed.

OS: macOS 10.16
Word size of FreeCAD: 64-bit
Version: 0.20.26155 (Git)
Build type: Release
Branch: master
Hash: 0926a4148bcff11249fd4f56bc30256102ffe105
Python version: 3.9.7
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.5.3
Locale: C/Default (C)
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

Re: Run an in-memory macro as if run by MacroManager

Post by TheMarkster »

Perhaps the lack of git python is part of the issue with windows versions. Yet if I enter into the python console:

Code: Select all

from git import Repo
it works without a hitch.

But I think it might be fixed anyway. I applied the patch to my local files, so I don't know if fixing the ssl certificate solved it or not. There is mention of this in the developer board.
User avatar
chennes
Veteran
Posts: 3878
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Run an in-memory macro as if run by MacroManager

Post by chennes »

The Git Python thing is separate from the Wiki thing -- the macros on the wiki are only fetched from the wiki, over https. The Git Python difference is whether we can use git clone to download a repo, or if we have to download the zip file instead.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
thomas-neemann
Veteran
Posts: 11801
Joined: Wed Jan 22, 2020 6:03 pm
Location: Osnabrück DE 🇩🇪
Contact:

Re: Run an in-memory macro as if run by MacroManager

Post by thomas-neemann »

TheMarkster wrote: Mon Oct 25, 2021 5:06 am ...
Sorry if my question doesn't quite fit here, but I've been looking for a way to integrate "return" into a freecad macro for hours. here is the thread:


https://forum.freecadweb.org/viewtopic.php?f=22&t=72820

you write:


Bildschirmfoto_2022-10-23_19-56-26.png
Bildschirmfoto_2022-10-23_19-56-26.png (3.97 KiB) Viewed 354 times
you can do that in this line

Code: Select all

Gui.runCommand('Std_Copy',0)
use?
Gruß Dipl.-Ing. (FH) Thomas Neemann

https://www.youtube.com/@thomasneemann5 ... ry=freecad
Post Reply