Std AddonMgr/ru: Difference between revisions

From FreeCAD Documentation
(Created page with "{{Docnav/ru |Std DlgCustomize | |Std Tools Menu |IconL=Std_DlgCustomize.svg |IconR= |IconC=Freecad.svg }}")
(Updating to match new version of source page)
 
(35 intermediate revisions by 5 users not shown)
Line 2: Line 2:


{{Docnav/ru
{{Docnav/ru
|[[Std_DlgCustomize/ru|Std DlgCustomize]]
|[[Std_DlgCustomize/ru|Команда "Настройка..."]]
|
|
|[[Std_Tools_Menu/ru|Std Tools Menu]]
|[[Std_Tools_Menu/ru|Меню "Инструменты"]]
|IconL=Std_DlgCustomize.svg
|IconL=Std_DlgCustomize.svg
|IconR=
|IconR=
Line 18: Line 18:
}}
}}


<span id="Description"></span>
==Описание==
==Описание==


<div class="mw-translate-fuzzy">
<div class="mw-translate-fuzzy">
Команда '''Std AddonMgr''' открывает Менеджер дополнений. С его помощью Вы можете устанавливать и управлять [[external_workbenches/ru|сторонними верстаками]] и [[macros/ru|макросами]], предоставляемыми сообществом FreeCAD. Доступные верстаки и макросы берутся из двух репозиториев, [https://github.com/FreeCAD/FreeCAD-addons/ FreeCAD-addons] и [https://github.com/FreeCAD/FreeCAD-macros/ FreeCAD-macros], а так же страницы [[Macros_recipes/ru|рецепты макросов]].
'''Менеджер дополнений''' &mdash; инструмент для установки и управления дополнениями рабочих окружений и макросами, предоставляемых сообществом FreeCAD. Полный перечень рабочих окружений доступен в [https://github.com/FreeCAD/FreeCAD-addons/ репозитории дополнений].
</div>
</div>


Из-за изменений в платформе GitHub в 2020 году Менеджер дополнений больше не работает в FreeCAD 0.17 и в более ранних версиях. Вам нужно перейти на версию [https://github.com/freecad/freecad/releases/tag/0.18.5 0.18.5] или более позднюю. В качестве альтернативы вы можете устанавливать дополнения вручную, см. [[#Примечания|Примечания]] ниже.
[[Image:Std_AddonMgr_dialog.png]]
{{Caption|The Addon manager dialog box}}


<span id="Usage"></span>
==Использование==
==Применение==


# Select the {{MenuCommand|Tools → [[Image:Std_AddonMgr.svg|16px]] Addon manager}} option from the menu.
# Select the {{MenuCommand|Tools → [[Image:Std_AddonMgr.svg|16px]] Addon manager}} option from the menu.
# If you are using the Addon manager for the first time, a dialog box will open warning you that the addons in the Addon manager are not officially part of FreeCAD. Press the {{Button|OK}} button to confirm and continue.
# If you are using the Addon manager for the first time, a dialog box will open warning you that the addons in the Addon manager are not officially part of FreeCAD. It also presents several options related to the Addon manager's data usage. Adjust those options to your liking and press the {{Button|OK}} button to confirm and continue.
# The Addon manager dialog box opens. For more information see [[#Options|Options]].
# The Addon manager dialog box opens. For more information see [[#Options|Options]].
# The {{Button|[[Image:Button_valid.svg|16px]] Update all}} button does not work at this time.
# Press the {{Button|[[Image:Process-stop.svg|16px]] Close}} button to close the dialog box.
# If you have installed or updated a workbench a new dialog box will open informing you that you have to restart FreeCAD for the changes to take effect.
# If you have installed or updated a workbench a new dialog box will open informing you that you have to restart FreeCAD for the changes to take effect.


<span id="Options"></span>
==Опции==
==Опции==


[[File:AddonManager_Main.png|600px]]
The Addon manager dialog box has two tabs on the left, one listing the available workbenches and the other listing the available macros. The information panel on the right will display the homepage of the selected addon.


# 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.
===Uninstall===
# 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.


При нажатии на блок с кратким описанием дополнения в представленном окне, открывается страница с более детальными сведениями о дополнении:
# Select an installed addon on the [[Image:Folder.svg|16px]] '''Workbenches''' tab or the [[Image:Applications-python.svg|16px]] '''Macros''' tab.
# Press the {{Button|[[Image:Delete.svg|16px]] Uninstall selected}} button.


[[File:AddonManager_Details.png|600px]]
===Install/update===


На странице детального описания дополнения отображаются кнопки, позволяющие устанавливать, удалять, обновлять и временно отключать дополнение. Для уже установленных дополнений в нем указана текущая установленная версия и дата установки, а также является ли это самой последней доступной версией. Ниже показано встроенное окно веб-браузера, показывающее страницу README дополнения (для верстаков и пакетов настроек) или страницу Wiki (для макросов).
# Select an addon on the [[Image:Folder.svg|16px]] '''Workbenches''' tab or the [[Image:Applications-python.svg|16px]] '''Macros''' tab.
# Press the {{Button|[[Image:Edit_OK.svg|16px]] Install/update selected}} button.
# If you want to add a macro to a custom toolbar then don't forget to manually download the icon image file, if available, by clicking on the link on the homepage in the information panel. See [[Interface_Customization#Toolbars|Interface Customization]].
# To change the position of an addon workbench in the [[Std_Workbench|Workbench selector]] list see [[Interface_Customization#Workbenches|Interface Customization]].


<span id="Preferences"></span>
===Configuration===
==Настройки==


The preferences for the Addon manager can be found in the [[Preferences_Editor#Addon_Manager|Preferences Editor]]. {{Version|0.20}}
# Press the {{Button|[[Image:Preferences-general.svg|16px]] Configure...}} button.
# The Addon manager options dialog box opens.
# Optionally check the {{CheckBox|TRUE|Automatically check for updates at start (requires GitPython)}} checkbox.
# Optionally add repositories to the '''Custom repositories''' list. Addons from these repositories will be added on the [[Image:Folder.svg|16px]] '''Workbenches''' tab or the [[Image:Applications-python.svg|16px]] '''Macros''' tab.
# Optionally choose proxy settings.
# Press the {{Button|OK}} button or the {{Button|Cancel}} button to close the dialog box.


==Sorting by score==
==Notes==


{{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).

<span id="Notes"></span>
==Примечания==

* 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.
* 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.
* 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 make use of it, making downloads faster.
* 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]].
* 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]].


<span id="Information_for_addon_developers"></span>
==Information for developers==
==Информация для разработчиков дополнений==


См. [[Addon/ru#Информация для разработчиков|Дополнения]].
If you have developed a workbench or macro, and want to see it included in the Addon manager, read how to do so on the repository pages: ([https://github.com/FreeCAD/FreeCAD-addons/ FreeCAD-addons] and [https://github.com/FreeCAD/FreeCAD-macros/ FreeCAD-macros]). If you add your macro to the [[Macros_recipes|Macros recipes]] page, there is nothing else to do, it will automatically be picked up by the Addon manager.


<span id="Scripting"></span>
===Python workbenches===
==Программирование==


<div class="mw-translate-fuzzy">
For python workbenches, you don't need any specific approval to have your workbench added to the Addon manager and, being outside the FreeCAD source code, you can choose the license you want. If you request for your workbench to be added to the list (we will not add any new workbench without a request from its authors), either by asking so on the forum or by opening an issue on the [https://github.com/FreeCAD/FreeCAD-addons/ FreeCAD-addons] repository, your code will stay on your own git repository, we will just add it as a submodule to the [https://github.com/FreeCAD/FreeCAD-addons/ FreeCAD-addons] repository. Of course, before adding your workbench, we will take a look at it and make sure there is nothing potentially problematic with it.
{{Version/ru|0.21}}
</div>

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.

===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:

{{Code|code=
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).

Для удаления (деинсталляции), используйте:

{{Code|code=
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=
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 {{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.
===C++ workbenches===


If you develop a workbench in C++, it cannot be run directly by users and must be compiled first. You then have two options, either you provide precompiled versions of your workbench yourself, for the different operating systems, or you should request to have your code merged into the FreeCAD source code. For that, you should use the LGPL license (or a fully compatible license like MIT or BSD), and you must present your new tools to the community in the [https://forum.freecadweb.org FreeCAD forum] for review. Once your code has been tested and approved, you should fork the FreeCAD repository, if not done yet, create a new branch, push your code to it, and open a pull request so that your branch is merged into the main repository.


{{Docnav/ru
{{Docnav/ru
|[[Std_DlgCustomize/ru|Std DlgCustomize]]
|[[Std_DlgCustomize/ru|Команда "Настройка..."]]
|
|
|[[Std_Tools_Menu/ru|Std Tools Menu]]
|[[Std_Tools_Menu/ru|Меню "Инструменты"]]
|IconL=Std_DlgCustomize.svg
|IconL=Std_DlgCustomize.svg
|IconR=
|IconR=
Line 91: Line 154:
{{Std Base navi{{#translation:}}}}
{{Std Base navi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}
{{clear}}

Latest revision as of 10:06, 21 April 2024

Менеджер дополнений

Системное название
Нет
Расположение в меню
Инструменты → Менеджер дополнений
Верстаки
All
Быстрые клавиши
Нет
Представлено в версии
0.17
См. также
External workbenches, Макросы

Описание

Команда Std AddonMgr открывает Менеджер дополнений. С его помощью Вы можете устанавливать и управлять сторонними верстаками и макросами, предоставляемыми сообществом FreeCAD. Доступные верстаки и макросы берутся из двух репозиториев, FreeCAD-addons и FreeCAD-macros, а так же страницы рецепты макросов.

Из-за изменений в платформе GitHub в 2020 году Менеджер дополнений больше не работает в FreeCAD 0.17 и в более ранних версиях. Вам нужно перейти на версию 0.18.5 или более позднюю. В качестве альтернативы вы можете устанавливать дополнения вручную, см. Примечания ниже.

Применение

  1. Select the Tools → Addon manager option from the menu.
  2. If you are using the Addon manager for the first time, a dialog box will open warning you that the addons in the Addon manager are not officially part of FreeCAD. It also presents several options related to the Addon manager's data usage. Adjust those options to your liking and press the OK button to confirm and continue.
  3. The Addon manager dialog box opens. For more information see Options.
  4. If you have installed or updated a workbench a new dialog box will open informing you that you have to restart FreeCAD for the changes to take effect.

Опции

  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.

При нажатии на блок с кратким описанием дополнения в представленном окне, открывается страница с более детальными сведениями о дополнении:

На странице детального описания дополнения отображаются кнопки, позволяющие устанавливать, удалять, обновлять и временно отключать дополнение. Для уже установленных дополнений в нем указана текущая установленная версия и дата установки, а также является ли это самой последней доступной версией. Ниже показано встроенное окно веб-браузера, показывающее страницу README дополнения (для верстаков и пакетов настроек) или страницу Wiki (для макросов).

Настройки

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).

Примечания

  • 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.

Информация для разработчиков дополнений

См. Дополнения.

Программирование

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).

Для удаления (деинсталляции), используйте:

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.