.. meta:: :description: Extensions Plugin Plugins ======= This section explains how to create and edit plugins. .. _filesLocationPluginExtension: Files location -------------- To be recognized by the application, plugins should be located in one of these folders: - %LocalAppData%/ORS/Dragonfly31/pythonUserExtensions/Plugins (available for the current user) - %ProgramData%/ORS/Dragonfly31/pythonAllUsersExtensions/Plugins (available for all users) - %ProgramData%/ORS/Dragonfly31/python/OrsPythonPlugins (distributed with the application) .. note:: All the mandatory files defining a plugin should be contained in a folder having the same name as the plugin implementation file and the implementation class. For example, a simple plugin named ``ASimplePlugin`` would be constituted of these files: - %LocalAppData%/ORS/Dragonfly31/pythonUserExtensions/Plugins/ASimplePlugin/__init__.py - %LocalAppData%/ORS/Dragonfly31/pythonUserExtensions/Plugins/ASimplePlugin/ASimplePlugin.py See :ref:`extensionFiles` for more information on the purpose of each file. File creation ------------- To create a plugin, start the application, start the :mod:`OrsPythonPlugins.OrsPluginGenerator.OrsPluginGenerator` (found in *Developer/Python Plugin Generator*), fill in the required fields in the different tabs and press the button *Create plugin*. See :ref:`pluginElements` for more information on the elements of a plugin. File edition ------------ **Design the UI** If a UI is used, design it in the generated *.ui* file(s). See :ref:`howtodevelopui` for more information. **Develop the code** Open the implementation file (the Python file having the name of the plugin) in a text editor. Fill in the required methods. Demos ----- Plugins have been used in these sections to explain each plugin element: - :func:`ORSServiceClass.decorators.infrastructure.interfaceMethod`; - :func:`ORSServiceClass.decorators.infrastructure.menuItem`; - :func:`ORSServiceClass.decorators.infrastructure.action`; - :ref:`OrsPlugin_States`; - :func:`ORSServiceClass.decorators.infrastructure.interest`.