Commit Graph

59 Commits

Author SHA1 Message Date
pre-commit-ci[bot]
c8b72c144e [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2025-02-03 22:51:14 +00:00
bgbsww
64ecfe7a0e Make python Regex Strings raw to avoid py3.12 SyntaxError 2024-09-30 17:42:49 +02:00
Chris Hennes
2d5b665319 Addon Manager: Bug fixes and license cleanup 2024-02-11 17:19:23 -06:00
Chris Hennes
b446f2012d Addon Manager: Fixes for license handling 2024-02-11 17:19:23 -06:00
Chris Hennes
8109d8a3ae Addon Manager: Allow .py filenames
Also improve macro removal.
2024-01-26 17:43:37 -07:00
Chris Hennes
89579cff6e Addon Manager: Reformat with new Black line length 2023-09-02 13:38:08 -05:00
Chris Hennes
4d25a9347c Addon Manager: Fix git icons on wiki 2023-04-12 15:21:17 -05:00
Chris Hennes
4fc730db2b Addon Manager: Fix wiki macro icon cleanup 2023-03-23 21:49:05 -05:00
Chris Hennes
f1ffaf3ba9 Addon Manager: Handle icons with query strings 2023-03-10 17:30:51 -06:00
Chris Hennes
1f6c364fa6 Addon Manager: Refactor Metadata
Create a Python-native metadata class. Includes unit tests, and some PyLint cleanup.
2023-03-10 14:25:50 -06:00
Chris Hennes
9c6164bc07 Addon Manager: Add SPDX license ID to all files 2023-02-20 15:39:47 -06:00
Chris Hennes
b00572548f Addon Manager: Refactor macro
Reduce coupling with FreeCAD core.
2023-02-19 15:49:24 -06:00
Chris Hennes
d6fc29f057 Addon Manager: Refactor Macro parser 2023-02-13 23:46:57 -06:00
Chris Hennes
e188802ca6 Addon Manager: Update license headers 2023-01-28 13:07:29 -07:00
Chris Hennes
02b4a762b0 Addon Manager: Create new uninstaller 2022-12-18 22:15:40 -06:00
Chris Hennes
95f474a86a Addon Manager: Update to Python 3.8 2022-12-17 20:05:32 -06:00
Chris Hennes
89c191e160 Addon Manager: Refactor installation code
Improve testability of installation code by refactoring it to completely
separate the GUI and non-GUI code, and to provide more robust support
for non-GUI access to some type of Addon Manager activity.
2022-12-17 17:49:13 -06:00
Chris Hennes
dfef3be2d8 Addon Manager: Refactor Macro for testing
Pull out the network manager code so it is easier to mock.
2022-11-27 19:38:04 -06:00
Chris Hennes
5419bcb6e4 Addon Manager: Fix bad formatting in error handler 2022-11-27 19:38:04 -06:00
Chris Hennes
b407332475 Addon Manager: Qt6 migration part 1, use PySide
Migrate all uses of "import PySide 2" to use "import PySide" so that the
FreeCAD-provided wrappers can switch between Qt versions.
2022-11-06 13:19:36 +01:00
Chris Hennes
552d6ab895 Addon Manager: Add support for <pythonmin> tag 2022-09-26 11:04:42 -05:00
Chris Hennes
bf7732cbca Addon Manager: Fix macro missing warings 2022-09-20 09:05:05 -05:00
Chris Hennes
e0b181e9b1 Addon Manager: Fix macro other file copy 2022-09-09 13:00:11 -05:00
Chris Hennes
9ab037b581 Addon Manager: pylint cleanup of Macro class 2022-08-28 13:50:09 -05:00
Chris Hennes
4c63094331 Addon Manager: Worker refactor (round 1) 2022-08-09 10:23:26 -05:00
Chris Hennes
119a402c66 Addon Manager: Add other_files download for wiki macros 2022-07-30 21:31:26 -05:00
Chris Hennes
0e40b9956e Addon Manager: Improve bad icon handling 2022-04-09 15:15:13 -05:00
Chris Hennes
49b5e7b0c4 Addon Manager: Fix display of Macro wiki details 2022-03-29 15:47:15 -05:00
Chris Hennes
75d2233ed6 Addon Manager: Add wiki macro icon scraping 2022-02-26 21:06:37 -06:00
Chris Hennes
1a7fcd575e Addon Manager: Auto-create toolbar button
When installing a macro, prompt user to install a toolbar button
automatically. Fills in the details of the button using the macro's
metadata, including an icon if the __icon__ metadata variable points to
a file.

Also:
* Support XPM data for macro icon
* Support online icons
* Fix bug in macro uninstall
* Cleaned up macro code
2022-02-26 21:06:37 -06:00
Chris Hennes
85390bfb6d Addon Manager: Minor fixes and error tweaks
* Correct display of tags in list view
* Add error checking for branch name and url match
* Convert some messages to logs
2022-02-23 18:32:05 -06:00
Chris Hennes
781f0bd626 Addon Manager: Improve macro metadata extraction 2022-02-18 17:10:52 -06:00
Chris Hennes
88f6b2f432 Addon Manager: Translation cleanup
pylupdate does not extract translations when f-strings are used for the
translated text, so all f-strings are migrated to calls to format().
Several other minor translation issues are also addressed.

NOTE: This code has been run through the Black reformatter, which adds
trailing commas in many places that the stock Qt 5.x pylupdate does not
recognize. This code must be processed with the corrected pylupdate to
generate the correct translations.
2022-01-27 23:11:31 -06:00
Chris Hennes
f045a0b6f1 Addon Manager: Improve startup speed 2022-01-26 18:41:14 -06:00
Chris Hennes
2b0a4dc643 Addon Manager: Create NetworkManager class
To enable single-login authenticated proxy use, and simplified multi-threaded
network accesses, this commit adds a new wrapper around a QNetworkAccessManager
and includes a global instantiation of the class intended to exist for the
lifetime of the program. This instance can be used to enqueue any number of
network requests, which the manager will send out to the networking subsystem
in an appropriate manner.
2022-01-25 13:30:58 -06:00
Chris Hennes
efa08946f2 Addon Manager: Improve stability when cache update interrupted 2022-01-08 19:47:57 -06:00
Chris Hennes
64cf6a68d8 Addon Manager: Remove unused imports 2022-01-01 09:43:06 -06:00
Chris Hennes
70c9804fc0 Addon Manager: Ensure cache is rebuilt after firstrun dialog 2022-01-01 09:16:32 -06:00
Chris Hennes
b370d3dae4 Addon Manager: Improve wiki page data extraction 2022-01-01 09:16:32 -06:00
Chris Hennes
c746be388f Addon Manager: Improve macro scanning performance 2022-01-01 09:16:32 -06:00
Chris Hennes
4c5b8f368c Addon Manager: Implement simple macro metadata cache 2022-01-01 09:16:32 -06:00
Chris Hennes
ae5391eaf9 Addon Manager: Clean up report window output 2021-12-30 20:06:22 -06:00
Chris Hennes
787b1e0f56 Addon Manager: Black reformatting 2021-12-18 20:29:42 -06:00
Chris Hennes
52da213a3c Addon Manager: Improve cache behavior
Also includes a number of bug fixes.
2021-12-18 20:29:42 -06:00
Chris Hennes
a0992902de Addon Manager: Begin UI redesign
Migrate to a UI that looks more like other software package managers, giving
more space to each addon by hiding the list when an addon is selected, and
providing a "back" button to get back.

Implements a two-style view option for the list of addons: expanded and
condensed, via a delegate that provides the drawing function for each row in
the table based on two different widget designs.
2021-12-18 20:29:42 -06:00
Chris Hennes
768a0f086f Addon Manager: Rework backend to use package.xml
This shifts to use the model-view-controller pattern for the list of addons,
and moves to using a full model class rather than an indexed array for the
data storage and management. This enables much more information to be stored
as part of the new AddonManagerRepo data type. It now wraps the Macro class
for macros, supports Preference Packs, and provides access to the Metadata
object.
2021-12-18 20:29:42 -06:00
jreinhardt
72eb41b24f Fix macro code processing
I believe this code is currently incorrect, as it makes references to code outside the "if code" block, where it can not be ensured that code is a string. Moving the code processing into this block avoids this issue.

I experienced a stuck Addon Manager, which was caused by an exception

```
  File "/usr/share/freecad/Mod/AddonManager/addonmanager_macro.py", line ..., in fill_details_from_wiki
    FreeCAD.Console.PrintWarning(translate("AddonsInstaller", "Unable to clean macro code: ") + code + '\n')
TypeError: can only concatenate str (not "list") to str
```
which is fixed by these changes.

OS: Ubuntu 20.04.1 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.4.
Build type: Release
Python version: 3.8.2
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.3.0
Locale: English/United States (en_US)
2020-10-20 19:01:12 +02:00
Matsievskiy S.V
706a014ce9 AddonManager: Fix python imports
Move misplaced imports from addonmanager_macro to addonmanager_workers
2020-10-06 08:21:04 +02:00
Matsievskiy S.V
dde64d4a0a AddonManager: update python source formatting
Update formatting in compliance with pep8 with the following exceptions:

 * truncate to 120 characters in line

 * prefer double quotes `"` to single quotes `'` in strings
2020-10-01 09:53:34 +02:00
Zackles
d7d88da291 Add Proxy to Addon Manager with UI
Correct crash when Macro description is not reachable

Python crashed when under proxy - Macro list is charged - Proxy is undone ( internet connection lost) - Try to load macro description (u=None)

Add Proxy setting in Addon Manager Option UI

Correction of SSL context

Replace ssl.Purpose.CLIENT_AUTH by ssl.Purpose.SERVER_AUTH as context for a client

Add configuration of proxy setting UI

Add proxy management by urllib
2020-01-10 10:01:56 +01:00