-
Notifications
You must be signed in to change notification settings - Fork 0
/
webshare.patch
37 lines (31 loc) · 1.14 KB
/
webshare.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
diff --git a/getTemplate.cgi b/getTemplate.cgi
index 3f61d78..6d73c6b 100755
--- a/getTemplate.cgi
+++ b/getTemplate.cgi
@@ -34,14 +34,14 @@ except:
import CGI
import string
-import regex
+import re
import db
class getTemplateCGI (CGI.CGI):
# CLASS VARIABLES
pageElements = {} # holds element file -> file content mapping
- re_parm = regex.compile ('\${\([^}]+.element\)}') # to find 'foo.element'
+ re_parm = re.compile ('\\${([^}]+.element)}') # to find 'foo.element'
def resolve (self,
@@ -68,10 +68,12 @@ class getTemplateCGI (CGI.CGI):
if steps == 0:
raise error, 'Could not resolve parameter.'
s = getTemplateCGI.pageElements[file]
- while getTemplateCGI.re_parm.search (s) != -1:
- start, stop = getTemplateCGI.re_parm.regs[0]
- parm = getTemplateCGI.re_parm.group(1)
+ re_match = getTemplateCGI.re_parm.search (s)
+ while re_match:
+ start, stop = re_match.span()
+ parm = re_match.group(1)
s = s[:start] + self.resolve(parm, steps-1) + s[stop:]
+ re_match = getTemplateCGI.re_parm.search (s)
return s
def getDbDate (self):