diff options
| author | Sergey Schetinin <sergey@maluke.com> | 2011-06-30 17:52:23 +0300 |
|---|---|---|
| committer | Sergey Schetinin <sergey@maluke.com> | 2011-06-30 17:52:23 +0300 |
| commit | 700240d9366abfc5cecaab83dcaa5b3be4841938 (patch) | |
| tree | fa21984e7e2125b873a258c10021134e4f1fffda /docs/wiki-example-code | |
| parent | 070a77c525720a930b3be831bb6b72af9068ea5d (diff) | |
| download | webob-700240d9366abfc5cecaab83dcaa5b3be4841938.tar.gz | |
drop python 2.4 compatibility
Diffstat (limited to 'docs/wiki-example-code')
| -rw-r--r-- | docs/wiki-example-code/example.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/docs/wiki-example-code/example.py b/docs/wiki-example-code/example.py index 8caa1cd..1687dc2 100644 --- a/docs/wiki-example-code/example.py +++ b/docs/wiki-example-code/example.py @@ -38,7 +38,7 @@ EDIT_TEMPLATE = HTMLTemplate("""\ <form action="{{req.path_url}}" method="POST"> <input type="hidden" name="mtime" value="{{page.mtime}}"> Title: <input type="text" name="title" style="width: 70%" value="{{page.title}}"><br> - Content: <input type="submit" value="Save"> + Content: <input type="submit" value="Save"> <a href="{{req.path_url}}">Cancel</a> <br> <textarea name="content" style="width: 100%; height: 75%" rows="40">{{page.content}}</textarea> @@ -65,7 +65,7 @@ class WikiApp(object): try: meth = getattr(self, 'action_%s_%s' % (action, req.method)) except AttributeError: - raise exc.HTTPBadRequest('No such action %r' % action).exception + raise exc.HTTPBadRequest('No such action %r' % action) resp = meth(req, page) except exc.HTTPException, e: resp = e @@ -80,7 +80,7 @@ class WikiApp(object): if path.endswith('/'): path += 'index' if not path.startswith(self.storage_dir): - raise exc.HTTPBadRequest("Bad path").exception + raise exc.HTTPBadRequest("Bad path") path += '.html' return Page(path) @@ -138,7 +138,7 @@ class Page(object): content = self.full_content match = re.search(r'<title>(.*?)</title>', content, re.I|re.S) return match.group(1) - + @property def full_content(self): f = open(self.filename, 'rb') @@ -146,7 +146,7 @@ class Page(object): return f.read() finally: f.close() - + @property def content(self): if not self.exists: |
