The replacement method. This is passed a match object by re.sub(), which it uses to index the replacement dictionary and find the replacement string.
(self, matchobj)
| 25 | self.dict = dict |
| 26 | |
| 27 | def replace(self, matchobj): |
| 28 | """The replacement method. This is passed a match object by re.sub(), |
| 29 | which it uses to index the replacement dictionary and find the |
| 30 | replacement string.""" |
| 31 | key = matchobj.group(1) |
| 32 | if self.dict.has_key(key): |
| 33 | return self.dict[key] |
| 34 | else: |
| 35 | return '' |
| 36 | |
| 37 | class OpagCGI: |
| 38 | """This class represents a running instance of a CGI on the OPAG website. |
no test coverage detected