terça-feira, 15 de outubro de 2013

Edgewall TRAC: add a custon HTML code (like a menu) at the top of TRAC page

How to add custon HTML code like a menu/link in the TRAC interface.
In this case, users can return to the main page using a link.

Create the file "/path/to/env/templates/site.html" with the following content:
  <!--! Add site-specific style sheet -->
  <head py:attrs="select('@*')" py:match="head">
    <link href="${'site/style.css')}" rel="stylesheet" type="text/css"></link>

  <body py:attrs="select('@*')" py:match="body">

    <!--! MY LINK/MENU -->
<a href="PORTAL_LINK">Back to The Portal</a></center>

    <div id="siteheader">
    <div id="sitefooter">

You can add items in the header and footer of the TRAC page, inserting HTML code within DIV "siteheader" and "sitefooter"  respectively.

More information:

Edgewall TRAC update from 0.12.3 to 0.12.5 (Debian 7.2 - Wheezy) - DistributionNotFound

When I update TRAC of 0.12.3 to 0.12.5 using "aptitude" (Debian 7.2), the file "/usr/local/bin/trac-admin" was not updated automatically, generating the following error:
root@SERVER:/home/users# trac-admin /home/trac/PROJECT
Traceback (most recent call last):
  File "/usr/local/bin/trac-admin", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python2.7/dist-packages/", line 2711, in <module>
    parse_requirements(__requires__), Environment()
  File "/usr/lib/python2.7/dist-packages/", line 584, in resolve
    raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: Trac==0.12.3
To solve the defect, it was necessary to change the following items of the file "/usr/local/bin/trac-admin":
# EASY-INSTALL-ENTRY-SCRIPT: 'Trac==0.12.3','console_scripts','trac-admin'
__requires__ = 'Trac==0.12.5' #Changed from 0.12.3 to 0.12.5
import sys
from pkg_resources import load_entry_point

if __name__ == '__main__':
        load_entry_point('Trac==0.12.5', 'console_scripts', 'trac-admin')() #Changed from 0.12.3 to 0.12.5

That's all!

More information: