diff options
| author | ianb <devnull@localhost> | 2005-07-16 20:25:34 +0000 |
|---|---|---|
| committer | ianb <devnull@localhost> | 2005-07-16 20:25:34 +0000 |
| commit | 974d782b4509464688ca4c65398789521f1c30bc (patch) | |
| tree | ac4d470aeca2eedd9e1aa7ec7f55f7b5fc6e1b0e /paste | |
| parent | 1f37a2d311f9e72cd36241fd9f21e50f14765ce0 (diff) | |
| download | paste-974d782b4509464688ca4c65398789521f1c30bc.tar.gz | |
Added more transformations
Diffstat (limited to 'paste')
| -rwxr-xr-x | paste/docsupport/gensite.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/paste/docsupport/gensite.py b/paste/docsupport/gensite.py index 12501b7..09124dc 100755 --- a/paste/docsupport/gensite.py +++ b/paste/docsupport/gensite.py @@ -107,6 +107,17 @@ class RestFile(object): _start_re = re.compile(r'<div class=".*?" id="contents">') _end_re = re.compile(r'</div>[ \n]*</div>[ \n]*</body>') + _bad_res = [ + (re.compile(r'<link rel="stylesheet".*?>'), ''), + (re.compile(r'<h1 class="title">.*?</h1>'), ''), + (re.compile(r'(<p class=".*?"><a name="contents">.*?</p>)[ \n]*' + r'(<ul class="simple">)'), + '<div><ul class="simple contents">'), + (re.compile(r'(<th class="docinfo-name">Date:</th>[ \n]*)' + r'(<td>).*?\((.*?)\)'), + r'\1\2\3'), + ] + def read_content(self): c = self.html m = self._start_re.search(c) @@ -119,6 +130,8 @@ class RestFile(object): c = c[:m.start()] else: print 'Bad ending in %s' % self.filename + for regex, sub in self._bad_res: + c = regex.sub(sub, c) self.content = c def __repr__(self): |
