Commit Graph

50 Commits

Author SHA1 Message Date
Chris Hennes
b253f5acce Addon Manager: Use Vermin to detect min Python 2022-09-26 11:04:42 -05:00
Chris Hennes
9492849f4a Addon Manager: Pylint cleanup of utilities 2022-08-25 09:50:12 -05:00
Chris Hennes
2286635e49 Addon Manager: Refactoring and pylint cleanup 2022-08-21 14:32:15 -05:00
Chris Hennes
2e51954b2b Addon Manager: Worker refactor (round 1) 2022-08-09 10:23:26 -05:00
Chris Hennes
ec1fbb5d69 Addon Manager: Utilities pylint cleanup 2022-07-27 11:52:57 -05:00
Chris Hennes
4b1b6fff59 Addon Manager: Fix get_zip_url for non-github URLs 2022-07-27 11:46:30 -05:00
Chris Hennes
514118192a Addon Manager: Cleanup 2022-07-27 10:49:00 -05:00
Chris Hennes
044b7ed744 Addon Manager: Add dialog to manage Python deps 2022-07-27 09:59:25 -05:00
Chris Hennes
17aed10f6f Addon Manager: Renaming and cleanup 2022-02-27 22:50:54 -06:00
0penBrain
4db58c2c6e AddonManager: improve dark mode heuristic 2022-02-27 18:44:58 -06:00
Chris Hennes
27a7c60802 Addon Manager: Minor improvements to utilities 2022-02-25 20:41:03 -06:00
Chris Hennes
038d9cfb2f Addon Manager: Improve darkmode check 2022-02-24 12:05:08 -06:00
Chris Hennes
964ff6428b Addon Manager: Improve macro metadata extraction 2022-02-18 17:10:52 -06:00
Chris Hennes
994071c43b Addon Manager: Switch to QWebEngineView for README
Rather than manually parsing the output from the repo's host, the Addon Manager
now uses an embedded QWebEngineView to display the README data. This makes the
display more repo-location agnostic (rather than trying to parse the specific
code from GitHub, Gitlab, etc.). Special handling of known hosts is still
provided to improve the display of the page, but it is not required. Clicking a
link on the page still loads in a new system browser window, with the exception
of links to the FreeCAD wiki, which are loaded in the same browser. This is
expected to be used primarily to access traslated pages for Macros, so no
advanced web-browsing features are displayed (e.g. back buttons, history
access, etc.).
2022-02-02 23:42:29 -06:00
Chris Hennes
c62dc32739 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
e9d6a2c4a4 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
8d96cadb69 Addon manager: install dependencies (#5376)
Addon Manager: Dependency Installation

The Addon Manager can now attempt to use pip directly to install
required packages as specified in either metadata.txt or
requirements.txt files provided by AddOns. The packages are installed
into FreeCAD.getUserAppDataDir()/AdditionalPythonPackages directory.
Only simplified requirements.txt data is supported: any version
information is stripped out, and only packages are supported (that is,
no pip arguments, included files, etc.). Further, packages are checked
against a list of allowed packages prior to being suggested for
installation. Addon authors should submit a PR to the FreeCAD repo
adding their requirements to the allowed list, for packages that are not
already on the list (this is a malware-prevention mechanism).
2022-01-21 10:19:21 -06:00
Chris Hennes
910baff0d0 Addon Manager: Remove progress object from git pull 2022-01-10 10:45:23 -06:00
Chris Hennes
06144dd944 Addon Manager: Display download progress 2022-01-09 00:46:07 -06:00
Chris Hennes
ad2169e5ae Addon manager dependency resolver (#5339)
Squashed:
* Addon Manager: Refactor metadata.txt download
* Addon Manager: Basic dependency walker
* Addon Manager: Add basic support for dependencies
* Addon Manager: Improve network detection messaging
* Addon Manager: Black reformat
* Addon Manager: Display dependency info in dialog
* Addon Manager: Dependency dialog added
* Addon Manager: Improve display of update all results
* Addon Manager: Improve display of package list
* Addon Manager: Fix codespell
* Addon Manager: Clean up unused signal
2022-01-07 10:16:44 -06:00
Chris Hennes
172243138a Addon Manager: Improve display of installation details 2022-01-01 11:41:23 -06:00
Chris Hennes
6f1c2627b2 Addon Manager: Remove unused imports 2022-01-01 09:43:06 -06:00
Chris Hennes
e954f677fb Addon Manager: Downgrade failed low-level urlopen to log 2022-01-01 09:16:32 -06:00
Chris Hennes
f5f78670dd Addon Manager: Add preference to control macro download 2022-01-01 09:16:32 -06:00
Chris Hennes
e450e50bb2 Addon Manager: Implement simple macro metadata cache 2022-01-01 09:16:32 -06:00
Chris Hennes
20a74ce423 Addon Manager: Clean up report window output 2021-12-30 20:06:22 -06:00
Chris Hennes
3cc2d402cf Addon Manager: Black reformatting 2021-12-18 20:29:42 -06:00
Chris Hennes
ba3d921f3f Addon Manager: Bugfixes and cleanup of refactor 2021-12-18 20:29:42 -06:00
Chris Hennes
fa8cac06f4 Addon Manager: Add support for salsa.debian.org
The pyrate has moved to salsa.debian.org, so this commit adds the
beginnings of support for those repos.The Markdown library is required
for nice rendering of repos that don't have a package.xml metadata file.
2021-12-18 20:29:42 -06:00
Chris Hennes
a225695dd8 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
Chris Hennes
fe06f869a5 [Addon Manager] Silence LGTM warnings about urls
The URLs used to detect whether a repo is at github, gitlab, or framagit
could potentially be mis-detected by a maliciously-crafted URL,
resulting in incorrect detection of the README file, etc. To silence the
LGTM warning about this, proper URL sanitization and comparison is now
used.
2021-09-26 20:13:02 -05:00
Yorik van Havre
3ebab330f4 AddonManager: Fixed path of gitlab readme 2021-09-17 15:47:00 +02:00
Matsievskiy S.V
ba69518c36 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
Matsievskiy S.V
07db27d0dd Addon Manager: change lookup mechanism
Switch addon lookup mechanism from parsing html page to extracting info
from .gitmodules file.
This simplifies logic and allows using non-Github repos.

Readme for Github repos are extracted from HTML pages using regex.

Gitlab pages are converted to HTML using Python Markdown lib if present,
falling back to displaying raw markdown.
In this case image links are converted from relative to absolute paths.
2020-10-01 09:53:34 +02:00
Kisolre
f3972e6fff Fix for changed Github url links being relative instead of absolute. 2020-06-25 15:07:50 +02:00
Syres916
7b2d445dc2 [AddonManager] Backu=out CheckGitBinary fn 2020-05-08 11:35:59 +02:00
Syres916
82093a4f28 [AddonManager] Utilities add Check Git Binary 2020-05-04 11:54:55 +02:00
0penBrain
f1f4e2b5f2 [AddonManager] Support for UTF8 encoded macros 2020-04-01 13:27:27 +02:00
zacl
06ef9b044d Remove trailing whitespace 2020-01-10 10:01:56 +01:00
Zackles
33206bb6fc 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
Yorik van Havre
a6334a4bfd Cleanup in doxygen stuff 2019-07-15 23:20:52 -03:00
Yorik van Havre
c4d43eab4c AddonManager: Better support of non-github addons 2019-07-12 16:45:31 -03:00
Yorik van Havre
09bfdb02bf AddonManager: Provisions to support different git hosting platforms than github 2019-07-10 18:29:02 -03:00
Mark Ganson TheMarkster
fe7883d97f added UR_'s bugfix
https://forum.freecadweb.org/viewtopic.php?f=3&t=37382&start=10#p317980
2019-07-02 20:01:54 -03:00
Yorik van Havre
8e4be1a67a AddonManager: Fixes for translation 2019-06-17 20:06:32 -03:00
Yorik van Havre
8d7afb0b61 AddonManager: Misc fixes from forum testers 2019-06-15 17:53:36 -03:00
Yorik van Havre
41d7cbb517 AddonManager: solved missing FreeCAD import 2019-06-12 19:36:02 -03:00
Yorik van Havre
ab68749909 AddonManager: New UI 2019-06-11 17:06:11 -03:00
luz.paz
2b02659010 Misc. typo and whitespace fixes
Found via `codespell`
2019-05-30 19:56:12 +02:00
Gaël Écorchard
58b5749163 [AddonManager] separate the Macro class
Separate the Macro class of the AddonManager into addonmanager_macro.py
to prepare for future support for dependent files for macros from the
git repository.
2018-10-25 11:04:43 -03:00