Mercurial > p > roundup > code
view website/issues/extensions/local_replace.py @ 4703:8e34362a14f7
issue2550774: Fix generating the website documentation
- the COPYING.txt file needs to be symlinked into website/www/ so the
documentation can be generated correctly
- add website/www/COPYING.txt to the .hgignore file so the symlinked version
does not get accidentally committed to the repository
- the website documentation Makefile 'clean' removes the symlinks and the
generated html to return things back to the original state, which is what
should happen on a 'clean'
| author | John Kristensen <john@jerrykan.com> |
|---|---|
| date | Sun, 16 Dec 2012 13:18:11 +1100 |
| parents | 6dd24be45fb3 |
| children | 7140ebfc3764 |
line wrap: on
line source
import re substitutions = [ (re.compile('debian:\#(?P<id>\d+)'), '<a href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=\g<id>">debian#\g<id></a>' ), (re.compile('\#(?P<ws>\s*)(?P<id>\d+)'), "<a href='issue\g<id>'>#\g<ws>\g<id></a>" ), (re.compile('(?P<prews>\s+)revision(?P<ws>\s*)(?P<revision>\d+)'), "\g<prews><a href='http://svn.roundup-tracker.org/viewvc/roundup?view=rev&rev=\g<revision>'>revision\g<ws>\g<revision></a>"), (re.compile('(?P<prews>\s+)rev(?P<ws>\s*)(?P<revision>\d+)'), "\g<prews><a href='http://svn.roundup-tracker.org/viewvc/roundup?view=rev&rev=\g<revision>'>rev\g<ws>\g<revision></a>"), (re.compile('(?P<prews>\s+)(?P<revstr>r|r\s+)(?P<revision>\d+)'), "\g<prews><a href='http://svn.roundup-tracker.org/viewvc/roundup?view=rev&rev=\g<revision>'>\g<revstr>\g<revision></a>"), ] def local_replace(message): for cre, replacement in substitutions: message = cre.sub(replacement, message) return message def init(instance): instance.registerUtil('localReplace', local_replace) if "__main__" == __name__: print " debian:#222", local_replace(" debian:#222") print " revision 222", local_replace(" revision 222") print " wordthatendswithr 222", local_replace(" wordthatendswithr 222") print " r222", local_replace(" r222") print " r 222", local_replace(" r 222") print " #555", local_replace(" #555")
