Attachment 'MySQL.py.parser.diff'
Download 1 --- MySQL.py.orig 2007-03-27 15:26:00.000000000 +1200
2 +++ MySQL.py 2007-03-27 15:51:40.000000000 +1200
3 @@ -16,6 +16,7 @@
4 """
5
6 import sys
7 +import string,re
8 from MoinMoin import wikiutil, config
9 import MySQLdb
10 import re
11 @@ -27,6 +28,7 @@
12 _re_evenattr=re.compile("EVENATTR (?P<EVENATTR>.*)")
13 _re_oddattr=re.compile("ODDATTR (?P<ODDATTR>.*)")
14 _re_wikicol=re.compile("WIKICOLUMN (?P<WIKICOLUMN>.*)")
15 +_re_wmlcol=re.compile("WMLCOLUMN (?P<WMLCOLUMN>.*)")
16 _re_htmlcol=re.compile("HTMLCOLUMN (?P<HTMLCOLUMN>.*)")
17 _re_mailcol=re.compile("MAILCOLUMN (?P<MAILCOLUMN>.*)")
18 _re_hidden=re.compile("HIDDENCOLUMN (?P<HIDDENCOLUMN>.*)")
19 @@ -36,9 +38,10 @@
20 <img src="/wiki/rightsidebar/img/moin-www.png"
21 alt="[www]" width="11" height="11">%s</a>'''
22 _format_wikiref=' <a href="%s">%s</a>'
23 -_format_mailto='<a href="mailto:%s">%s</a>'
24 +_format_wmlref=' <a href="%s">%s</a>'
25 +_format_mailto=' <a href="mailto:%s">%s</a>'
26
27 class Preference:
28 def __init__(self):
29 @@ -51,6 +54,7 @@
30 self.header=''
31 self.html=''
32 self.wiki=''
33 + self.wml=''
34 self.mail=''
35 self.hidden=''
36
37 @@ -91,6 +95,8 @@
38 output.append(params.linebreak)
39 output.append('[WIKICOLUMN columnnumber1,columnnumber2,...,...]')
40 output.append(params.linebreak)
41 + output.append('[WMLCOLUMN columnnumber1,columnnumber2,...,...] use | to separate two columns, aa|bb will become a link to aa labelled as bb')
42 + output.append(params.linebreak)
43 output.append('[MAILCOLUMN columnnumber1,columnnumber2,...,...]')
44 output.append(params.linebreak)
45 output.append('[HIDDENCOLUMN columnnumber1,columnnumber2,...,...]')
46 @@ -148,6 +154,10 @@
47 if match and match.groupdict().has_key('WIKICOLUMN'):
48 params.wiki=match.group('WIKICOLUMN').split(',')
49
50 + match=_re_wmlcol.search(parameterstring)
51 + if match and match.groupdict().has_key('WMLCOLUMN'):
52 + params.wml=match.group('WMLCOLUMN').split(',')
53 +
54 match=_re_htmlcol.search(parameterstring)
55 if match and match.groupdict().has_key('HTMLCOLUMN'):
56 params.html=match.group('HTMLCOLUMN').split(',')
57 @@ -210,13 +220,17 @@
58 aColumnNumber=aColumnNumber+1
59 element=unicode(str(aCell) , config.charset)
60 if str(aColumnNumber) in params.hidden:
61 - conitnue
62 + continue
63 if str(aColumnNumber) in params.html:
64 isHTML=1
65 element=_format_href % (str(aCell), str(aCell) )
66 if str(aColumnNumber) in params.wiki:
67 isHTML=1
68 element=_format_wikiref % (str(aCell), str(aCell) )
69 + if str(aColumnNumber) in params.wml:
70 + isHTML=1
71 + wml=str(aCell).split("|")
72 + element=_format_wmlref % (str(wml[0]), str(wml[1]) )
73 if str(aColumnNumber) in params.mail:
74 isHTML=1
75 element=_format_mailto % (str(aCell),str(aCell))
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.