Addon Manager improvements

Info about new community or project announcements, implemented features, classes, modules or APIs. Might get technical!
PLEASE DO NOT POST HELP REQUESTS OR OTHER DISCUSSIONS HERE!
wmayer
Site Admin
Posts: 14790
Joined: Thu Feb 19, 2009 10:32 am

Re: Addon Manager improvements

Postby wmayer » Thu Jun 13, 2019 2:42 pm

When opening the Addon Manager and switching between the two tabs very quickly then after a while an exception is raised and FreeCAD crashes. The error text is:
Err: Traceback (most recent call last):
Err: File "C:\Projects\FreeCAD-git\lp3\Mod\AddonManager\addonmanager_workers.py", line 228, in run
Err: Err: self.retrieve_macros_from_git()Err:
Err: File "C:\Projects\FreeCAD-git\lp3\Mod\AddonManager\addonmanager_workers.py", line 252, in retrieve_macros_from_git
Err: Err: git.Repo.clone_from('https://github.com/FreeCAD/FreeCAD-macros.git', self.repo_dir)Err:
Err: File "C:\Projects\FreeCADLibs_12.1.3_x64_VC15\bin\lib\site-packages\git\repo\base.py", line 988, in clone_from
Err: Err: return cls._clone(git, url, to_path, GitCmdObjectDB, progress, **kwargs)Err:
Err: File "C:\Projects\FreeCADLibs_12.1.3_x64_VC15\bin\lib\site-packages\git\repo\base.py", line 939, in _clone
Err: Err: finalize_process(proc, stderr=stderr)Err:
Err: File "C:\Projects\FreeCADLibs_12.1.3_x64_VC15\bin\lib\site-packages\git\util.py", line 333, in finalize_process
Err: Err: proc.wait(**kwargs)Err:
Err: File "C:\Projects\FreeCADLibs_12.1.3_x64_VC15\bin\lib\site-packages\git\cmd.py", line 415, in wait
Err: Err: raise GitCommandError(self.args, status, errstr)Err:
Err: git.excErr: .Err: GitCommandErrorErr: : Err: Cmd('git') failed due to: exit code(128)
cmdline: git clone -v https://github.com/FreeCAD/FreeCAD-macros.git C:\Users\xxxxxxx\AppData\Local\Temp\tmp3w6zr_ry
stderr: 'fatal: destination path 'C:\Users\xxxxxxx\AppData\Local\Temp\tmp3w6zr_ry' already exists and is not an empty directory.
'Err:
Err: QThread: Destroyed while thread is still running
Err: Abnormal program termination...Err:
To me it looks like switching to another tab the spawned thread will be destroyed instead of letting it finish.
User avatar
Kunda1
Posts: 5519
Joined: Thu Jan 05, 2017 9:03 pm

Re: Addon Manager improvements

Postby Kunda1 » Thu Jun 13, 2019 5:48 pm

Just a low priority feature request, that instead of folders as icons in the left frame, that we use the actual icons for each workbench to help with branding said workbench. This of course requires the Workbench authors to create an icon for their workbench. I don't think this is a bad idea. Thoughts?
FYI, icons could be found at https://www.freecadweb.org/wiki/Template:DevWorkbenches
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
Kunda1
Posts: 5519
Joined: Thu Jan 05, 2017 9:03 pm

Re: Addon Manager improvements

Postby Kunda1 » Thu Jun 13, 2019 6:22 pm

yorik wrote:
Tue Jun 11, 2019 8:09 pm
New UI for the addons manager in git commit 3e65306a9!

The functionality is basically still the same as before, but it shows the whole README. Also, it is now fully translatable.
Notated open feature request for this in https://github.com/FreeCAD/FreeCAD-addons/issues/37
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
sgrogan
Posts: 5333
Joined: Wed Oct 22, 2014 5:02 pm

Re: Addon Manager improvements

Postby sgrogan » Thu Jun 13, 2019 8:46 pm

yorik wrote:
Thu Jun 13, 2019 1:09 am
You can check in C:/Users/Chris/AppData/Roaming/FreeCAD/AddonManager/Images, that's where the images get downloaded. They are downloaded only once, after that all other times they will be found and reused automatically. But I noticed some images in some readme's fail to download indeed...
I get this
Capture.PNG
Capture.PNG (132.34 KiB) Viewed 501 times
None of the images show in the addons manager. Note that some don't have the .png extension. Some of those non .png extension files I can open in paint, some are not recognized as a valid image file?
User avatar
yorik
Site Admin
Posts: 11514
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: Addon Manager improvements

Postby yorik » Thu Jun 13, 2019 10:42 pm

Thanks for the further testing guys!
wmayer wrote:
Thu Jun 13, 2019 2:42 pm
To me it looks like switching to another tab the spawned thread will be destroyed instead of letting it finish.
Yes probably. I did something against that when you switch to one addon to the other (force-finish), but forgot to do it when you switch from tab to tab... Will do.
Kunda1 wrote:
Thu Jun 13, 2019 5:48 pm
Just a low priority feature request, that instead of folders as icons in the left frame, that we use the actual icons for each workbench to help with branding said workbench. This of course requires the Workbench authors to create an icon for their workbench. I don't think this is a bad idea. Thoughts?
Good idea, but it would add annoying extra load time to fetch them from the wiki. Maybe, since we have all those icons anyway, we could simply add them into the FreeCAD source and bundle them in the addon manager. Would you want to help with that? It would basically be just creating a Resources/icons folder inside AddonManager folder, and place all the svg files there, taking care of giving them the exact same name as the addon. Then I'll do the rest.
sgrogan wrote:
Thu Jun 13, 2019 8:46 pm
None of the images show in the addons manager. Note that some don't have the .png extension. Some of those non .png extension files I can open in paint, some are not recognized as a valid image file?
On my system they also don't have extension. That's how github stores them unfortunately, and we can't guess if it's png or jpg or whatever. But the QTextBrowser doesn't seem to mind here... And if you don't see the ones with an extension either, then the problem is elsewhere.

You're on windows, right? Anyone else on windows could test?
User avatar
Kunda1
Posts: 5519
Joined: Thu Jan 05, 2017 9:03 pm

Re: Addon Manager improvements

Postby Kunda1 » Thu Jun 13, 2019 11:02 pm

yorik wrote:
Thu Jun 13, 2019 10:42 pm
Kunda1 wrote:
Thu Jun 13, 2019 5:48 pm
Just a low priority feature request, that instead of folders as icons in the left frame, that we use the actual icons for each workbench to help with branding said workbench. This of course requires the Workbench authors to create an icon for their workbench. I don't think this is a bad idea. Thoughts?
Good idea, but it would add annoying extra load time to fetch them from the wiki. Maybe, since we have all those icons anyway, we could simply add them into the FreeCAD source and bundle them in the addon manager. Would you want to help with that? It would basically be just creating a Resources/icons folder inside AddonManager folder, and place all the svg files there, taking care of giving them the exact same name as the addon. Then I'll do the rest.
:+1:
Do you want me to make a PR to master and ping you within the PR ?

Edit: https://github.com/FreeCAD/FreeCAD/pull/2261
Last edited by Kunda1 on Fri Jun 14, 2019 12:17 am, edited 1 time in total.
Reason: Added PR
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
sgrogan
Posts: 5333
Joined: Wed Oct 22, 2014 5:02 pm

Re: Addon Manager improvements

Postby sgrogan » Fri Jun 14, 2019 7:55 pm

yorik wrote:
Thu Jun 13, 2019 10:42 pm
You're on windows, right? Anyone else on windows could test?
Yes Windows. Maybe this is similar to some off the missing icons/images when the start page was updated?
I'll make a post in install compile to ask for testers. I'll also upload my build to the github pre-releases page.
User avatar
GlouGlou
Posts: 1595
Joined: Sun Apr 05, 2015 9:02 am
Location: La Rochelle, France

Re: Addon Manager improvements

Postby GlouGlou » Sat Jun 15, 2019 8:44 am

Some WBs seems unable to come...

Can't see some pictures...



OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.16989 (Git)
Build type: Release
Branch: master
Hash: f48f8bfaac3d4fbe1be92416e6ceff25699d52d1
Python version: 2.7.14
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: French/France (fr_FR)
Attachments
Capture2.JPG
Capture2.JPG (117.41 KiB) Viewed 379 times
Capture.JPG
Capture.JPG (60.53 KiB) Viewed 379 times
Syres
Posts: 351
Joined: Thu Aug 09, 2018 11:14 am

Re: Addon Manager improvements

Postby Syres » Sat Jun 15, 2019 4:34 pm

I managed to get the Curves Wb Readme to display correctly by changing line 429 in src\Mod\AddonManager\addonmanager_workers.py from:

Code: Select all

                    message = message.replace(path,"file://"+storename.replace("\\","/"))
to:

Code: Select all

                    message = message.replace(path,"file:///"+storename.replace("\\","/"))
I'm having trouble with the Silk Wb not saving the images as, and I'm completely guessing here but, the url ends in '?raw=true', therefore the url for the first image is :

https://github.com/edwardvmills/Silk/bl ... g?raw=true

rather than:

https://raw.githubusercontent.com/edwar ... emo_02.png

Because the image doesn't exist in the directory I get the following in Report View:

Code: Select all

Traceback (most recent call last):
  File "E:\Data\My Downloads\FreeCAD_0.19.16993_x64_LP_12.1.2_PY3QT5-WinVS2015\FreeCAD_0.19.16993_x64_LP_12.1.2_PY3QT5-WinVS2015\Mod\AddonManager\addonmanager_workers.py", line 385, in run
    l = self.loadImages( message )
  File "E:\Data\My Downloads\FreeCAD_0.19.16993_x64_LP_12.1.2_PY3QT5-WinVS2015\FreeCAD_0.19.16993_x64_LP_12.1.2_PY3QT5-WinVS2015\Mod\AddonManager\addonmanager_workers.py", line 417, in loadImages
    f = open(storename,"wb")
OSError: [Errno 22] Invalid argument: 'C:\\Users\\JPS\\AppData\\Roaming\\FreeCAD\\AddonManager\\Images\\Silk_Demo_02.png?raw=true'
OS: Windows 7 SP 1 (6.1)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.16993 (Git)
Build type: Release
Branch: master
Hash: 5ea062f6699666b2f284f6a52105acf20828b481
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United Kingdom (en_GB)
User avatar
sgrogan
Posts: 5333
Joined: Wed Oct 22, 2014 5:02 pm

Re: Addon Manager improvements

Postby sgrogan » Sat Jun 15, 2019 7:08 pm

Syres wrote:
Sat Jun 15, 2019 4:34 pm
I managed to get the Curves Wb Readme to display correctly by changing line 429 in src\Mod\AddonManager\addonmanager_workers.py from:
Thanks for testing. Your fix helps many add-on WB's. I can confirm the behavior for Silk. It seems many other links are web links ie /furti/FreeCAD-ArchTextures/blob/master ... xtured.png prepending github.com makes it work in a browser.