Edgewall Software

Version 16 (modified by brianw, 13 years ago) ( diff )

added note about workaround for PyDev debug not working

How to develop Trac with Eclipse PyDev

Follow the instructions for Setting up the environment and Installing and configuring Trac on the Developer setup for Trac page, before configuring Eclipse and PyDev.

Installing and configuring Eclipse

  1. Install Eclipse (3.3 or newer will do).
  2. Install the PyDev plugin for Eclipse.
  3. (Optional) Install either Subclipse or Subversive for Eclipse-integrated Subversion tools.
  4. In Eclipse, make sure that the PYTHONPATH in the project properties dialog includes the sources for trac.
  5. Create an initial run configuration by clicking right on trac/web/standalone.py file, and choosing Run As→Python Run. Trac will complain that no environment has been set.
  6. Select Run→Open Run Dialog… and set the correct command line arguments in the arguments tab, eg. —port 8000 /path/to/myproject.
    • Note that the option —auto-reload will cause tracd to restart every time source code has been changed, but it seems to prevent debugging with PyDev. This seems to have something to do way Trac reloads new instance as a child thread using "thread" library which doesn't seem to be compatible with PyDev debugging. Googling revelead some hints that instead using "thread"-module you should use "threading"-module (higherlevel)
    • Note that if you debugging doesn't work with a plugin then remove the package from the install destination (eg. rm -Rf) and soft link it from your source.
  7. You should now be able to run tracd, as well as to debug it using the same run configuration. To run the test cases, just click on a test folder and select Run→Python unit tests

Automatic translation compilation

If you want to setup automatic translation compilation it can be done very easily.

  1. Right click on trac project and select Properties. Select Builders. Click New. Select Program.
  2. Name builder, like 'Locale fi_FI builder'
  3. Main tab:
    • Location: click Browse File System…. Select Python executable.
    • Working Directory: set it to ${project_loc}
    • Arguments: setup.py compile_catalog -f -l fi_FI (change to your locale)
  4. Refresh tab:
    • Check Refresh resources upon completion.
    • Select Spesific resources and select trac/locale/fi_FI (select your locale)
  5. Build Options tab:
    • Check During auto builds.
    • Check Specify working set of relevan resources.
    • Click Specify resources…. select trac/locale/fi_FI (select your locale, same as in step 4).
    • Name it like fi_FI locale.
  6. After modifying your message.po file you should get following output:
     running compile_catalog
     compiling catalog 'trac/locale\\fi_FI\\LC_MESSAGES\\messages.po' to 'trac/locale\\fi_FI\\LC_MESSAGES\\messages.mo'
    

If Trac is running, your changes will be effective immediately.

Thanks

Originally these instructions were posted on trac-dev list by Joachim Hoessler.

Attachments (1)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.