diff MoinMoin/action/newpage.py @ 1183:bc84eae93f8c

replace usage of find by 'in' operator
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Mon, 14 Aug 2006 01:24:01 +0200
parents cbbde07e00c4
children 544b931cd965
line wrap: on
line diff
--- a/MoinMoin/action/newpage.py	Mon Aug 14 00:54:29 2006 +0200
+++ b/MoinMoin/action/newpage.py	Mon Aug 14 01:24:01 2006 +0200
@@ -29,7 +29,7 @@
         @return: error message
         """
         _ = self.request.getText
-        need_replace = self.nametemplate.find('%s') != -1
+        need_replace = '%s' in self.nametemplate
         if not self.pagename and need_replace:
             return _("Cannot create a new page without a page name."
                      "  Please specify a page name.")
@@ -38,7 +38,7 @@
         # template variable
             repl = 'A@'
             i = 0
-            while self.nametemplate.find(repl) != -1:
+            while repl in self.nametemplate:
                 repl += ['#', '&', '$', 'x', 'X', ':', '@'][i]
                 i += 1
                 i = i % 7