vendredi 12 novembre 2010

SPMPT Tutorial : Trac plugins

Hi !
Today I will explain how to add some plugins to your trac.

Bases :
Trac is programmed with Python, so plugins are generally programmed with Python too.
SPMPT is shipped with easy_install which permit you to install easly Python softwares. So to install some plugins to Trac, most of them needs easy_install.

easy_install path is /Applications/MAMP/python/framework/Python.framework/Versions/2.6/bin/easy_install

Generally Trac's plugins give a documentation, how to install them, so read it with attention.
In this example we will install TracWysiwygPlugin.

1) Launch Terminal.app (/Applications/Utilities/Terminal.app)

2) use easy_install to install the plugin like descripted in documentation, with SPMPT the path to easy_install is a little much long, don't forget to set the right Trac version (there 0.11) : /Applications/MAMP/python/framework/Python.framework/Versions/2.6/bin/easy_install http://trac-hacks.org/svn/tracwysiwygplugin/0.11


3) Processing
Downloading http://trac-hacks.org/svn/tracwysiwygplugin/0.11

Doing subversion checkout from http://trac-hacks.org/svn/tracwysiwygplugin/0.11 to /var/folders/lp/lp5TCmnQGCysjlEsUJnPy++++TM/-Tmp-/easy_install-slznk8/0.11

Processing 0.11

Running setup.py -q bdist_egg --dist-dir /var/folders/lp/lp5TCmnQGCysjlEsUJnPy++++TM/-Tmp-/easy_install-slznk8/0.11/egg-dist-tmp-eYEvnS

zip_safe flag not set; analyzing archive contents...

Adding TracWysiwyg 0.11.0.2-r8691 to easy-install.pth file

Installed /Applications/MAMP/python/framework/Python.framework/Versions/2.6/lib/python2.6/site-packages/TracWysiwyg-0.11.0.2_r8691-py2.6.egg

Processing dependencies for TracWysiwyg==0.11.0.2-r8691

Finished processing dependencies for TracWysiwyg==0.11.0.2-r8691


4) The plugin was downloaded, build and installed by easy_install in few seconds.
5) Now you need to enabled TracWysiwygPlugin in your trac project using trac.ini. trac.ini is located in : TRACDIRECTORY/conf/trac.ini

6) You have to referer to documentation

7) You need to add in section
[components]
tracwysiwyg.* = enabled


8) You need to refresh trac, now you have a better editor.

Most plugins works like this : easy_install to install, trac.ini to configure/enabled

Special thank to Kiruakiller

Regards
Cédric

Aucun commentaire:

Enregistrer un commentaire