Changes between Version 4 and Version 5 of HelloWorldPlugin


Ignore:
Timestamp:
Sep 30, 2005, 7:14:32 AM (9 years ago)
Author:
athomas
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • HelloWorldPlugin

    v4 v5  
    1313== Download ==
    1414
    15 Copy and paste [http://projects.edgewall.com/trac/wiki/TracDev/PluginDevelopment#Addingcustomplugins this].
     15Copy and paste [trac:TracDev/PluginDevelopment#Writingtheplugincode this].
    1616
    17 = Example =
     17= Installing =
    1818
    19 Authoritative instructions [http://projects.edgewall.com/trac/wiki/TracDev/PluginDevelopment#Deployingacustomplugin here], but reproduced below:
     19Authoritative instructions [trac:TracDev/PluginDevelopment#Packaginganddeployingplugins here], but reproduced below:
    2020
    21 To register a custom plugin with a Trac environment, you edit the {{{trac.ini}}} file to add a new configuration section for your plugin. Let's assume the above plugin is in a Python module with the name {{{example.helloworld}}}:
     21trac:TracPlugins are packaged as [http://peak.telecommunity.com/DevCenter/PythonEggs Python Eggs]. You can use [http://peak.telecommunity.com/DevCenter/setuptools setuptools] to make a `setup.py` script that will produce a Python Egg for your plugin.
    2222
     23
     24The egg file needs to have a file named `trac_plugin.txt` in its `EGG-INFO` directory. This file should contain the names of all modules that need to be imported by Trac to register your components.
     25
     26  ''Note that this will change in the very near future: setuptools 0.6 will introduce the concept of “entry points”, which will be used instead of the `trac_plugin.txt` descriptor.''. See TracPlugins for details.
     27
     28A plugin can either be deployed globally, or only for a specific environment. Global deployment is done by installing the plugin:
    2329{{{
    24 [helloworld]
    25 module = example.helloworld
    26 path = /home/cmlenz/src/trac-plugins
     30$ cd /path/to/pluginsource
     31$ python setup.py install
     32
    2733}}}
     34
     35To deploy a plugin only to a specific Trac environment, copy the egg file into the `plugins` directory of that environment:
     36{{{
     37$ cd /path/to/pluginsource
     38$ python setup.py bdist_egg
     39$ cp dist/*.egg /path/to/projenv/plugins
     40}}}
     41
     42During development of a plugin, it is inconvenient to have to install it in either of the ways described above. Instead, you should use the setuptools `develop` command:
     43{{{
     44$ cd /path/to/pluginsource
     45$ python setup.py develop --install-dir=/path/to/projenv/plugins
     46}}}
     47
     48You can omit the `--install-dir` argument to make the development version of your plugin available globally.
     49
     50This will install an `.egg-link` file instead of the actual egg. That file is basically a link to the source directory of your plugin, so that Trac will always see the latest version of your code.
     51
     52A tutorial to build your own plugins is available here: EggCookingTutorial
    2853
    2954== Author/Contributors ==
    3055
    31 '''Author:''' [http://projects.edgewall.com/trac/wiki/TracTeam TracTeam]
     56'''Author:''' trac:TracTeam
    3257
    3358