diff MoinMoin/PageGraphicalEditor.py @ 1868:64507f46beb2

reduce usage of has_key()
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 10 Mar 2007 22:01:07 +0100
parents b180f047d918
children b07b4c102d3d
line wrap: on
line diff
--- a/MoinMoin/PageGraphicalEditor.py	Sat Mar 10 20:54:09 2007 +0100
+++ b/MoinMoin/PageGraphicalEditor.py	Sat Mar 10 22:01:07 2007 +0100
@@ -85,7 +85,7 @@
 
         # check if we want to load a draft
         use_draft = None
-        if form.has_key('button_load_draft'):
+        if 'button_load_draft' in form:
             wanted_draft_timestamp = int(form.get('draft_ts', ['0'])[0])
             if wanted_draft_timestamp:
                 draft = self._load_draft()
@@ -162,7 +162,7 @@
             # If the page exists, we get the text from the page.
             # TODO: maybe warn if template argument was ignored because the page exists?
             raw_body = self.get_raw_body()
-        elif form.has_key('template'):
+        elif 'template' in form:
             # If the page does not exists, we try to get the content from the template parameter.
             template_page = wikiutil.unquoteWikiname(form['template'][0])
             if request.user.may.read(template_page):
@@ -370,8 +370,8 @@
         badwords_re = None
         if preview is not None:
             if SpellCheck and (
-                    form.has_key('button_spellcheck') or
-                    form.has_key('button_newwords')):
+                    'button_spellcheck' in form or
+                    'button_newwords' in form):
                 badwords, badwords_re, msg = SpellCheck.checkSpelling(self, request, own_form=0)
                 request.write("<p>%s</p>" % msg)
         request.write('</fieldset>')