Std AddonMgr/ro: Difference between revisions

From FreeCAD Documentation
(Updating to match new version of source page)
(Updating to match new version of source page)
 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<languages/>
<languages/>

{{Docnav
|[[Std_DlgCustomize|DlgCustomize]]
|
|[[Std_Tools_Menu|Std Tools Menu]]
|IconL=Std_DlgCustomize.svg
|IconR=
|IconC=Freecad.svg
}}

<div class="mw-translate-fuzzy">
<div class="mw-translate-fuzzy">
{{GuiCommand/ro
{{GuiCommand/ro
Line 12: Line 22:
</div>
</div>


==Description==
<div class="mw-translate-fuzzy">
[[AddonManager|Addon Manager]] ”-gestionarul de extensii-” este un instrument pentru a instala și administra [[external workbenches/ro|external workbenches]] atelierele de lucru și [[macros/ro|macros]] oferite de comunitatea FreeCAD. Dacă pachetul [https://github.com/gitpython-developers/GitPython git-python] este instalat pe computer, Managerul de aplicații addon îl va utiliza pentru a actualiza atelierele de lucru instalate, făcând descărcările mai rapide.
</div>


<div class="mw-translate-fuzzy">
<div class="mw-translate-fuzzy">
[[Std_AddonMgr|Addon Manager]] ”-gestionarul de extensii-” este un instrument pentru a instala și administra [[external workbenches/ro|external workbenches]] atelierele de lucru și [[macros/ro|macros]] oferite de comunitatea FreeCAD. Dacă pachetul [https://github.com/gitpython-developers/GitPython git-python] este instalat pe computer, Managerul de aplicații addon îl va utiliza pentru a actualiza atelierele de lucru instalate, făcând descărcările mai rapide.
Lista completă a atelierelor care pot fi instalate este disponibilă la două depozite [https://github.com/FreeCAD/FreeCAD-addons/ FreeCAD-addons] și [https://github.com/FreeCAD/FreeCAD-macros/ FreeCAD-macros], respectiv și de la [[Macros recipes/ro|Macros recipes]].
</div>
</div>


Due to changes to the GitHub platform in the year 2020 the Addon manager no longer works if you use FreeCAD version 0.17 or earlier. You need to upgrade to version [https://github.com/FreeCAD/FreeCAD/releases/tag/0.18.5 0.18.5] or later. Alternatively you can install addons manually, see [[#Notes|Notes]] below.
<div class="mw-translate-fuzzy">
[[Image:Addon_Manager_example.png]]
{{Caption|Interface of the [[Addon Manager/ro|Addon Manager]]}}
</div>


<span id="Usage"></span>
<div class="mw-translate-fuzzy">
<div class="mw-translate-fuzzy">
== Cum se folosește ==
== Cum se folosește ==
Line 40: Line 46:
</div>
</div>


==Options==
=== Instalare manuală ===
Dacă nu utilizați Managerul Addon, puteți instala manual noile instrumente, plasându-le codul în directorul {{incode|FreeCAD/}} al utilizatorului. Vedeți următoarele linkuri pentru detalii:
* [[How to install macros/ro|How to install macros]]
* [[How to install additional workbenches/ro|How to install additional workbenches]]


[[File:AddonManager_Main.png|600px]]
==Limite==


# The Addon manager provides two view layouts: "Condensed" and "Expanded". In "Condensed" view, each addon takes a single line, and its description is truncated to fit the available space. "Expanded" shows additional details, including more of the description text as well as maintainer information, more installation details, etc.
* Aceste add-ons nu fac parte din pachetul oficial FreeCAD și nu sunt suportate de nucleul echipei FreeCAD. Trebuie să citiți informațiile furnizate pe fiecare dintre paginile de extensie înainte de a instala oricare dintre ele, pentru a vă asigura că știți ce instalați.
# Three different types of addons are supported: [[external_workbenches|workbenches]], [[macros|macros]], and [[Preference_Packs|preference packs]]. You can choose to show just one type, or all of them in a single list.
# The list can be limited to show just installed packages, just packages with available updates, or just packages that are not yet installed.
# The list can be filtered, searching for a keyword in the title, description, and tags (description and tags must be specified by the addon developer in their addon's metadata). The filter can even be a regular expression, for fine-grained control of the exact search term.
# The expanded view shows available version information, description, maintainer information, and installation version information, for packages that provide a [[Package_Metadata|package metadata]] file (or for macros with embedded metadata).
# Addon data is cached locally, with a variable cache update frequency set in the user preferences.
# At any time you can choose to manually update your local cache to see the latest updates available for each addon.
# Update checks may be set up to be automatic, or done manually via a button click (configured in user preferences). If GitPython and git are installed on your system then update information is fetched using git. If not, then update information is obtained from any present metadata file.


Clicking on an addon in this view brings up the addon's Details page:
* Rapoartele de eroare și cererile de caracteristici ar trebui să fie făcute direct la fiecare pagină de add-on, sau la creatorul de add-on pe [https://forum.freecadweb.org FreeCAD forum].


[[File:AddonManager_Details.png|600px]]
* The web addresses of the repositories for add-ons and macros are hard coded into the AddonManager. As this application is written in Python, experienced users can change these locations by editing the appropriate fields in


The details page shows buttons allowing installing, uninstalling, updating, and temporarily disabling an addon. For installed addons it lists the currently installed version and the installation date, and whether that is the most recent version available. Below is an embedded web browser window showing the addon's README page (for workbenches and preference packs), or Wiki page (for macros).
:{{Code|code=

$ROOT/Mod/AddonManager/AddonManager.py
==Preferences==

The preferences for the Addon manager can be found in the [[Preferences_Editor#Addon_Manager|Preferences Editor]]. {{Version|0.20}}

==Sorting by score==

{{Version|1.0}}

The Addon Manager supports sorting by a number of different criteria. Most of these are downloaded directly from FreeCAD's servers (which caches them from GitHub and the FreeCAD Wiki) but one, "Score," is not provided by FreeCAD at all, and only appears as an option if the Score Source URL setting is provided in the Preferences.

The Score Source URL is a path to a remote JSON-formatted document listing addons and a "score" of some kind. Score can be calculated in any way the data provider likes, but should be an integer value, with higher scores being "better" in some sense. Any addon not listed is assigned a score of zero internally. The format of the file is a single JSON dictionary where the key is the addon URL (for workbenches and preference packs) or the name of the macro (for macros). See [https://gist.githubusercontent.com/chennes/e8f60e80f16e6ffbd057dd47ca36ad2a/raw/7b118cca8e84444c3379919bbd744b99e6ef6711/addon_score_for_testing.json this data source] for an example (note the score there is simply the length of the addon's description, and is intended only for testing and demonstration purposes).

==Notes==

* The use of addons is not restricted to the FreeCAD version they were installed from. You will also be able to use them in any other FreeCAD version, supported by the addon, that you may have on your system.
* The addons available in the Addon manager are not part of the official FreeCAD program and are not supported by the core FreeCAD development team. You should read the provided information carefully to make sure you know what you are installing.
* Bug reports and feature requests should be made directly to the creator of the addon by visiting the indicated website. Many addon developers are regular users of the [https://forum.freecadweb.org FreeCAD forum], and can also be contacted there.
* If the [https://github.com/gitpython-developers/GitPython GitPython] package is installed on your computer the Addon manager will use it, making downloads faster.
* You can also install addons manually. See [[How_to_install_additional_workbenches|How to install additional workbenches]] and [[How_to_install_macros|How to install macros]].

==Information for addon developers==

See [[Addon#Information_for_developers|Addon]].

==Scripting==

{{Version|0.21}}

Some features of the Addon manager are designed for access via FreeCAD's Python API. In particular an addon can be installed, updated, and removed via the Python interface. Most uses of this API require you to create an object with at least three attributes: {{Incode|name}}, {{Incode|branch}} and {{Incode|url}}. For example:

{{Code|code=
class MyAddonClass:
def __init__(self):
self.name = "TestAddon"
self.url = "https://github.com/Me/MyTestAddon"
self.branch = "main"
my_addon = MyAddonClass()
}}
}}


Your object {{Incode|my_addon}} is now ready for use with the Addon manager API.
: where {{incode|$ROOT}} is the installation directory of FreeCAD in your particular system, for example,
:* Linux: {{incode|/usr/lib/freecad/Mod/AddonManager/AddonManager.py}}
:* Windows: {{Incode|C:\Program Files\FreeCAD version\Mod\AddonManager.py}}


===Commandline (non-GUI) use===
== Noi aeliere de lucru și macro-uri ==


If your code needs to install or update an addon synchronously (e.g. without a GUI) the code can be very simple:
<div class="mw-translate-fuzzy">
Dacă ați dezvoltat un atelier de lucru sau o macrocomandă și doriți să îl vedeți inclus în Addon Manager, citiți cum să faceți acest lucru în paginile de depozitului ([https://github.com/FreeCAD/FreeCAD-addons/ FreeCAD-addons] și [https://github.com/FreeCAD/FreeCAD-macros/ FreeCAD-macros]). Dacă adăugați macrocomanda în [[Macros recipes/ro|Macros recipes]], nu mai este nimic altceva de făcut, acesta va fi selectat automat de către Addon Manager.
</div>


{{Code|code=
Pentru atelierele de lucru python, nu aveți nevoie de aprobarea specifică pentru a adăuga atelierul dvs. de lucru la Addon Manager și, în afara codului sursă al FreeCAD, puteți alege licența dorită. Dacă cereți ca atelierul dvs. de lucru să fie adăugat pe listă (nu vom adăuga un nou atelier de lucru fără o solicitare din partea autorilor săi), fie prin solicitarea acestuia pe forum, fie prin deschiderea unei probleme în [https://github.com / FreeCAD / FreeCAD-addons / FreeCAD-addons], codul dvs. va rămâne pe propriul depozit git, îl vom adăuga ca submodul la [https://github.com/FreeCAD/FreeCAD-addons/ FreeCAD- addons] repository. Desigur, înainte de a adăuga atelierul dvs. de lucru, vom examina acest lucru și vă vom asigura că nu există nimic potențial problematic cu acesta.
from addonmanager_installer import AddonInstaller
installer = AddonInstaller(my_addon)
installer.run()
}}


Note that this code blocks until complete, so you shouldn't run it on the main GUI thread. To the Addon manager, "install" and "update" are the same call: if this addon is already installed, and git is available, it will be updated via "git pull". If it is not installed, or was installed via a non-git installation method, it is downloaded from scratch (using git if available).
Dacă dezvoltați un aelier de lucru în C ++, acesta nu poate fi rulat direct de către utilizatori și trebuie compilat mai întâi. Apoi, aveți două opțiuni, fie că furnizați dvs. înșiși versiuni precompilate ale atelierului dvs. de lucru, fie pentru diferite sisteme de operare, fie că doriți să introduceți codul sursă în codul sursă al FreeCAD. Pentru aceasta, ar trebui să utilizați licența LGPL (sau pe deplin compatibilă ca MIT sau BSD) și trebuie să prezentați noile instrumente comunității pe forumul [https://forum.freecadweb.org FreeCAD] pentru examinare. Odată ce codul dvs. a fost testat și aprobat, ar trebui să bifurcați depozitului FreeCAD, dacă nu ați făcut-o deja, pentru a crea o nouă ramură, în care să puneți codul și să solicitați, astfel încât ramura dvs. să fuzioneze în depozitul principal.


To uninstall, use:
== Testing the Addon Manager ==
{{VeryImportantMessage|This section is for developers}}
The Addon Manager is coded in Python so it's possible to change the source code without compiling it. More specifically, testing requires modifying the code in {{incode|FreeCAD/src/Mod/AddonManager}} and simply re-running FreeCAD.


{{Code|code=
To test downloading capability of the Addon Manager you can simulate a need to download say, a previous version of a workbench via the CLI. In the following example we'll use the Assembly2+ workbench (or [[A2plus_Workbench|A2plus]] for short):
from addonmanager_uninstaller import AddonUninstaller
uninstaller = AddonUninstaller(my_addon)
uninstaller.run()
}}

===GUI use===

If you plan on your code running in a GUI, or supporting running in the full version of FreeCAD, it's best to run your installation in a separate non-GUI thread, so the GUI remains responsive. To do this, first check to see if the GUI is running, and if it is, spawn a {{Incode|QThread}} (don't try to spawn a {{Incode|QThread}} if the GUI is not up: they require an active event loop to function).


{{Code|code=
{{Code|code=
from PySide import QtCore
cd ~/FreeCAD/Mod/A2plus/
from addonmanager_installer import AddonInstaller
git reset --hard "v0.4.21"

worker_thread = QtCore.QThread()
installer = AddonInstaller(my_addon)
installer.moveToThread(worker_thread)
installer.success.connect(installation_succeeded)
installer.failure.connect(installation_failed)
installer.finished.connect(worker_thread.quit)
worker_thread.started.connect(installer.run)
worker_thread.start() # Returns immediately
}}
}}


Then define the functions {{Incode|installation_succeeded}} and {{Incode|installation_failed}} to be run in each case. For uninstallation you can use the same technique, though it is usually much faster and will not block the GUI for very long, so in general it's safe to use the uninstaller directly, as shown above.
CLI output should show '''HEAD is now at b2c53a4 Merge pull request #281 from kbwbe/devel'''


<div class="mw-translate-fuzzy">
{{Userdocnavi/ro}}
</div>


{{clear}}
{{Docnav
|[[Std_DlgCustomize|DlgCustomize]]
|
|[[Std_Tools_Menu|Std Tools Menu]]
|IconL=Std_DlgCustomize.svg
|IconR=
|IconC=Freecad.svg
}}


{{Std Base navi{{#translation:}}}}
{{Std Base navi{{#translation:}}}}

{{Userdocnavi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}

[[Category:Addons{{#translation:}}]]

Latest revision as of 10:06, 21 April 2024

Addon manager

poziția meniului
Tools → Addon manager
Ateliere
None
scurtătură
nici unul
Prezentat în versiune
0.17
A se vedea, de asemenea,
Macros, External workbenches

Description

Addon Manager ”-gestionarul de extensii-” este un instrument pentru a instala și administra external workbenches atelierele de lucru și macros oferite de comunitatea FreeCAD. Dacă pachetul git-python este instalat pe computer, Managerul de aplicații addon îl va utiliza pentru a actualiza atelierele de lucru instalate, făcând descărcările mai rapide.

Due to changes to the GitHub platform in the year 2020 the Addon manager no longer works if you use FreeCAD version 0.17 or earlier. You need to upgrade to version 0.18.5 or later. Alternatively you can install addons manually, see Notes below.

Cum se folosește

  • Deschideți meniul de instrumente Tools → Addon manager.
  • Pentru a instala un atelier sau o macro: derulați în jos lista și selectați atelierul de completare. O scurtă descriere a atelierului suplimentar va fi afișată sub listă, precum și link-ul către pagina complementară. Apoi apăsați butonul Install/update pentru a instala noul instrument. Pentru macro-uri, faceți clic pe tab-ul Macros și repetați pașii.
  • Pentru a elimina un atelier sau macro parcurgeți lista, selectați atelierul sau add-on și apăsați butonul Install/update .
  • Pentru a actualiza un atelier sau macro parcurgeți, selectați plugin-ul și apăsați butonul Install/update.
  • Pentru a verifica actualizările apăsați Refresh Actulaizările disponibile vor fi raportatea în partea de jos a listei. Apăsați Refresh pentru a instala odată toate actualizările
Note: Notă: pictograma poate să arate diferit în funcție de sistemul dvs. de operare. Actualizările disponibile vor fi raportate în listă. 
  • Pentru a rula o macrocomandă: instalați mai întâi macroul dorit, apoi selectați din nou din listă, apoi apăsați butonul Execute.
  • Apăsați butonul Close pentru a ieși din manager.

Options

  1. The Addon manager provides two view layouts: "Condensed" and "Expanded". In "Condensed" view, each addon takes a single line, and its description is truncated to fit the available space. "Expanded" shows additional details, including more of the description text as well as maintainer information, more installation details, etc.
  2. Three different types of addons are supported: workbenches, macros, and preference packs. You can choose to show just one type, or all of them in a single list.
  3. The list can be limited to show just installed packages, just packages with available updates, or just packages that are not yet installed.
  4. The list can be filtered, searching for a keyword in the title, description, and tags (description and tags must be specified by the addon developer in their addon's metadata). The filter can even be a regular expression, for fine-grained control of the exact search term.
  5. The expanded view shows available version information, description, maintainer information, and installation version information, for packages that provide a package metadata file (or for macros with embedded metadata).
  6. Addon data is cached locally, with a variable cache update frequency set in the user preferences.
  7. At any time you can choose to manually update your local cache to see the latest updates available for each addon.
  8. Update checks may be set up to be automatic, or done manually via a button click (configured in user preferences). If GitPython and git are installed on your system then update information is fetched using git. If not, then update information is obtained from any present metadata file.

Clicking on an addon in this view brings up the addon's Details page:

The details page shows buttons allowing installing, uninstalling, updating, and temporarily disabling an addon. For installed addons it lists the currently installed version and the installation date, and whether that is the most recent version available. Below is an embedded web browser window showing the addon's README page (for workbenches and preference packs), or Wiki page (for macros).

Preferences

The preferences for the Addon manager can be found in the Preferences Editor. introduced in version 0.20

Sorting by score

introduced in version 1.0

The Addon Manager supports sorting by a number of different criteria. Most of these are downloaded directly from FreeCAD's servers (which caches them from GitHub and the FreeCAD Wiki) but one, "Score," is not provided by FreeCAD at all, and only appears as an option if the Score Source URL setting is provided in the Preferences.

The Score Source URL is a path to a remote JSON-formatted document listing addons and a "score" of some kind. Score can be calculated in any way the data provider likes, but should be an integer value, with higher scores being "better" in some sense. Any addon not listed is assigned a score of zero internally. The format of the file is a single JSON dictionary where the key is the addon URL (for workbenches and preference packs) or the name of the macro (for macros). See this data source for an example (note the score there is simply the length of the addon's description, and is intended only for testing and demonstration purposes).

Notes

  • The use of addons is not restricted to the FreeCAD version they were installed from. You will also be able to use them in any other FreeCAD version, supported by the addon, that you may have on your system.
  • The addons available in the Addon manager are not part of the official FreeCAD program and are not supported by the core FreeCAD development team. You should read the provided information carefully to make sure you know what you are installing.
  • Bug reports and feature requests should be made directly to the creator of the addon by visiting the indicated website. Many addon developers are regular users of the FreeCAD forum, and can also be contacted there.
  • If the GitPython package is installed on your computer the Addon manager will use it, making downloads faster.
  • You can also install addons manually. See How to install additional workbenches and How to install macros.

Information for addon developers

See Addon.

Scripting

introduced in version 0.21

Some features of the Addon manager are designed for access via FreeCAD's Python API. In particular an addon can be installed, updated, and removed via the Python interface. Most uses of this API require you to create an object with at least three attributes: name, branch and url. For example:

class MyAddonClass:
    def __init__(self):
        self.name = "TestAddon"
        self.url = "https://github.com/Me/MyTestAddon"
        self.branch = "main"
my_addon = MyAddonClass()

Your object my_addon is now ready for use with the Addon manager API.

Commandline (non-GUI) use

If your code needs to install or update an addon synchronously (e.g. without a GUI) the code can be very simple:

from addonmanager_installer import AddonInstaller
installer = AddonInstaller(my_addon)
installer.run()

Note that this code blocks until complete, so you shouldn't run it on the main GUI thread. To the Addon manager, "install" and "update" are the same call: if this addon is already installed, and git is available, it will be updated via "git pull". If it is not installed, or was installed via a non-git installation method, it is downloaded from scratch (using git if available).

To uninstall, use:

from addonmanager_uninstaller import AddonUninstaller
uninstaller = AddonUninstaller(my_addon)
uninstaller.run()

GUI use

If you plan on your code running in a GUI, or supporting running in the full version of FreeCAD, it's best to run your installation in a separate non-GUI thread, so the GUI remains responsive. To do this, first check to see if the GUI is running, and if it is, spawn a QThread (don't try to spawn a QThread if the GUI is not up: they require an active event loop to function).

from PySide import QtCore
from addonmanager_installer import AddonInstaller

worker_thread = QtCore.QThread()
installer = AddonInstaller(my_addon)
installer.moveToThread(worker_thread)
installer.success.connect(installation_succeeded)
installer.failure.connect(installation_failed)
installer.finished.connect(worker_thread.quit)
worker_thread.started.connect(installer.run)
worker_thread.start() # Returns immediately

Then define the functions installation_succeeded and installation_failed to be run in each case. For uninstallation you can use the same technique, though it is usually much faster and will not block the GUI for very long, so in general it's safe to use the uninstaller directly, as shown above.