About Site Map Submit Contact Us Log in | Create an account
Create an account Log In
Average Rating
User Rating:
Visitors Rating:
My rating:

Write review
See full specifications

linux default iconcommentator for Linux Publisher's description

WSGI commenting middleware

Make a factory wrapping your app in the commentator middleware. Currently, commentator only pickles comments. To the constructor of Commentator, pass a database (the path to the pickle) and a pattern. The pattern is in the form of
< URL pattern >#< xpath pattern > -> URL
The URL pattern is a python regular expression to match against the request's PATH_INFO.
The xpath pattern is where you want to place the comments on the page. See http://www.w3schools.com/XPath/ for more about xpath expressions.
The URL is a python string template that is substituted for groups in the URL regular expression and element attributes in the found nodes. The element attributes are referenced by name (${id}, ${class}, etc) and the groups are referenced by number (${1}, ...).
A reference implementation is illustrated in the commentator.ini file. This uses the pattern:
commentator.pattern = (.*)#.//div[@id='comment_on_this'] -> ${1}
What this pattern says is
* comment on every PATH_INFO (.*)
* append the rendered content template to div[@id='comment_on_this']
* reference the PATH_INFO as the canonical URL ${1}
To comment on every HTML page at the end of the body, you would use
commentator.pattern = (.*)#.//body -> ${1}
A more complex example is in the .ini file, commented out, for use with bitsyblog :
commentator.pattern = /blog/.*#.//div[@class='blog-entry'] -> /blog/${id}
This pattern says:
* comment on all paths under blog
* put the comments at the end of each div[@class='blog-entry']
* get the URI from the div's id, not from the PATH_INFO

System Requirements:

Program Release Status:
Program Install Support: Install and Uninstall

Is commentator for Linux your software?

Manage your software

Most Popular

linux default icon GDB 7.4
GDB, the GNU Project debugger, allows you to see what is going on `inside' another program while it... Read more
linux default icon Coral 0.9.1
Coral is a tool and a development platform to create and transform models and modeling languages.
linux default icon Forum Paid Plus Script 6.1
Forum Paid Pay Per Post Exchange is targeted at forum owners who wish to...
linux default icon sdo 0.6.5
Converts oracle SDO_GEOMETRY objects to WKT and GeoJSON.
linux default icon Get Paid Plus Script 6.1
Get Paid Plus Script

Related Category

» Other (877)
» Tools & Editors (359)
» Web Development (146)