Hi,
would it be difficult to replace the current CamelCase syntax
with a simple regular expression that may be customized in
the trac.ini file ?
For example, the current CamelCase convention seems to
me something like:
[wiki]
wiki_re = '[A-Z][a-z].*[A-Z][a-z].*'
One could easily want to change that to something project-specific,
for example even a simple list of special identifiers:
wiki_re = 'ThisWord|ThatWord'
I also tried to hack the api.py file as in the attachment, but is does
not seem to work. I guess it must be much more complex than this.
On a related note, what is the status of the FlexibleWikiPageNames
mentioned here:
http://trac.edgewall.org/wiki/FlexibleWikiPageNames
and where is the flexible-branch that is linked from such page to
an erroneous location ?
Thanks, regards,
T.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac
Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/trac-dev?hl=en
-~----------~----~----~----~------~----~------~--~---
--- lib/python2.5/site-packages/Trac-0.12dev_r7783-py2.5.egg/trac/wiki/api.py.orig 2009-01-11 23:03:48.000000000 +0100
+++ lib/python2.5/site-packages/Trac-0.12dev_r7783-py2.5.egg/trac/wiki/api.py 2009-01-11 23:53:57.000000000 +0100
@@ -380,16 +380,8 @@
>>> _check_unicode_camelcase(u"\xc9l\xe9PhanT")
False
"""
- if not pagename[0].isupper():
- return False
pagename = pagename.split('@', 1)[0].split('#', 1)[0]
- if not pagename[-1].islower():
- return False
- humps = 0
- for i in xrange(1, len(pagename)):
- if pagename[i-1].isupper():
- if pagename[i].islower():
- humps += 1
- else:
- return False
- return humps > 1
+ wiki_re = '.*[A-Z][a-z].*[A-Z][a-z].*'
+# wiki_re = self.env.config['wiki'].get('wiki_re')
+ p = re.compile(wiki_re)
+ return (p.match(pagename) != None)