Tuesday, May 29, 2007

Wikimedia as a presentation application

I tried wikimedia slides extension at first. It worked fine. However, if you'd like to present on wikimedia, I recommend another interesting approach: one of the Firefox Greasemonkey scripts - Wikipedia Presentation.

Thursday, May 10, 2007

Add Mantis links to ViewVC (ViewCVS)

A small modification to ViewVC adding links to our mantis system:

--- lib/viewvc.py.orig  2007-05-10 10:39:10.000000000 +0800
+++ lib/viewvc.py       2007-05-10 11:17:00.000000000 +0800
@@ -973,10 +973,12 @@
 # addresses.  Note that the regexps assume the text is already HTML-encoded.
 _re_rewrite_url = re.compile('((http|https|ftp|file|svn|svn\+ssh)(://[-a-zA-Z0-9%.~:_/]+)((\?|\&)([-a-zA-Z0-9%.~:_]+)=([-a-zA-Z0-9%.~:_])+)*(#([-a-zA-Z0-9%.~:_]+)?)?)')
 _re_rewrite_email = re.compile('([-a-zA-Z0-9_.\+]+)@(([-a-zA-Z0-9]+\.)+[A-Za-z]{2,4})')
+_re_rewrite_mantis = re.compile('(issue)([\ \#]+)(\d{1,7})')
 def htmlify(html):
   html = cgi.escape(html)
   html = re.sub(_re_rewrite_url, r'<a href="\1">\1</a>', html)
   html = re.sub(_re_rewrite_email, r'<a href="mailto:\1&#64;\2">\1&#64;\2</a>', html)
+  html = re.sub(_re_rewrite_mantis, r'<a href="/mantis/view.php?id=\3">\1\2\3</a>', html)
   return html

 def format_log(log, cfg):
@@ -1310,6 +1312,7 @@
   html = pp.fontify(html)
   html = re.sub(_re_rewrite_url, r'<a href="\1">\1</a>', html)
   html = re.sub(_re_rewrite_email, r'<a href="mailto:\1">\1</a>', html)
+  html = re.sub(_re_rewrite_mantis, r'<a href="/mantis/view.php?id=\3">\1\2\3</a>', html)
   return html

 def markup_stream_php(fp, cfg):

I believe it would be quite easy to understand the modification, which substitutes 'issue #id' to an URL link to mantis system.

For automatically adding a note to mantis when commit to CVS, please reference CVS Integration in Mantis manual.