Changes between Version 3 and Version 4 of TracPlugins
- Время:
- 10 апр. 2011 г., 17:54:28 (15 лет назад)
Обозначения:
- Без изменений
- Добавлено
- Удалено
- Изменено
-
TracPlugins
v3 v4 2 2 [[TracGuideToc]] 3 3 4 Since version 0.9, Trac supports [trac:PluginList plugins] that extend the built-in functionality. The plugin functionality is based on the [trac:TracDev/ComponentArchitecture component architecture].4 Trac is extensible with [trac:PluginList plugins] since version 0.9. The plugin functionality is based on the [trac:TracDev/ComponentArchitecture component architecture] with peculiarities described at [TracDev/PluginDevelopment plugin development] page. 5 5 6 Plugins can be either installed globally, in a shared plugins directory (see [TracIni#GlobalConfiguration Global Configuration]) or locally for specific TracEnvironment, in its `plugins` directory. 7 Except for the later case, the components defined in a plugin should be explicitly enabled in the [[TracIni#components-section| [components] ]] section of the trac.ini file. 6 == Plugin discovery == 8 7 9 == Requirements == 8 From the user point of view a Plugin is either standalone .py file or an .egg package. Trac looks for Plugins in a global shared plugins directory (see [TracIni#GlobalConfiguration Global Configuration]) and in `plugins` directory of local TracEnvironment. Components defined in globally installed plugins should be explicitly enabled in the [[TracIni#components-section| [components] ]] section of the trac.ini file. 9 10 == Requirements for Trac eggs == 10 11 11 12 To use egg based plugins in Trac, you need to have [http://peak.telecommunity.com/DevCenter/setuptools setuptools] (version 0.6) installed. … … 18 19 If the `ez_setup.py` script fails to install the setuptools release, you can download it from [http://www.python.org/pypi/setuptools PyPI] and install it manually. 19 20 20 Plugins can also consist of a single `.py` file dropped into either the environment or the shared pluginsdirectory.21 Plugins can also consist of a single `.py` file dropped directly into the root of environment's or into shared `plugins` directory. 21 22 22 23 == Installing a Trac Plugin == … … 56 57 }}} 57 58 58 If `easy_install` is not on your system see the Requirements section above to install it. Windows users will need to add the `Scripts` directory of their Python installation (for example, `C: Python24Scripts`) to their `PATH` environment variable (see [http://peak.telecommunity.com/DevCenter/EasyInstall#windows-notes easy_install Windows notes] for more information).59 If `easy_install` is not on your system see the Requirements section above to install it. Windows users will need to add the `Scripts` directory of their Python installation (for example, `C:\Python24\Scripts`) to their `PATH` environment variable (see [http://peak.telecommunity.com/DevCenter/EasyInstall#windows-notes easy_install Windows notes] for more information). 59 60 60 61 If Trac reports permission errors after installing a zipped egg and you would rather not bother providing a egg cache directory writable by the web server, you can get around it by simply unzipping the egg. Just pass `--always-unzip` to `easy_install`: 61 62 {{{ 62 easy_install --always-unzip TracSpamFilter-0. 2.1dev_r5943-py2.4.egg63 easy_install --always-unzip TracSpamFilter-0.4.1_r10106-py2.6.egg 63 64 }}} 64 65 You should end up with a directory having the same name as the zipped egg (complete with `.egg` extension) and containing its uncompressed contents. … … 70 71 `easy_install` makes installing from source a snap. Just give it the URL to either a Subversion repository or a tarball/zip of the source: 71 72 {{{ 72 easy_install http://svn.edgewall.com/repos/trac/plugins/0.1 1/spam-filter73 easy_install http://svn.edgewall.com/repos/trac/plugins/0.12/spam-filter-captcha 73 74 }}} 74 75 … … 90 91 `easy_install` or `python setup.py` does not have an uninstall feature. Hower, it is usually quite trivial to remove a globally installed egg and reference: 91 92 1. Do `easy_install -m [plugin name]` to remove references from `$PYTHONLIB/site-packages/easy-install.pth` when the plugin installed by setuptools. 92 1. Delete executables from `/usr/bin`, `/usr/local/bin` or `C:\ Python*Scripts`. For search what executables are there, you may refer to `[console-script]` section of `setup.py`.93 1. Delete executables from `/usr/bin`, `/usr/local/bin` or `C:\\Python*\Scripts`. For search what executables are there, you may refer to `[console-script]` section of `setup.py`. 93 94 1. Delete the .egg file or folder from where it is installed, usually inside `$PYTHONLIB/site-packages/`. 94 95 1. Restart web server.