Commits

Thomas Waldmann committed cb2ca94

use augmented assignments

Comments (0)

Files changed (9)

MoinMoin/converter/docbook_in.py

         a given element.
         """
         new_children = []
-        depth = depth + 1
+        depth += 1
         for child in element:
             if isinstance(child, ET.Element):
                 r = self.visit(child, depth)
         """
         self.is_section = True
         if depth > self.section_depth:
-            self.section_depth = self.section_depth + 1
-            self.heading_level = self.heading_level + 1
+            self.section_depth += 1
+            self.heading_level += 1
         elif depth < self.section_depth:
             self.heading_level = self.heading_level - (self.section_depth - depth)
             self.section_depth = depth
                             attrib={}, children=[label_tag, body_tag])
                     item_tag = (item_tag, )
                     new.extend(item_tag)
-                    counter = counter + 1
+                    counter += 1
                 else:
                     r = self.visit(child)
                     if r is None:

MoinMoin/converter/docbook_out.py

         if not title:
             #TODO: Translation
             title = "Table {0}".format(self.table_counter)
-        self.table_counter = self.table_counter + 1
+        self.table_counter += 1
         caption = ET.Element(docbook('caption'), attrib={}, children=[title])
         children = [caption]
         children.extend(self.do_children(element))

MoinMoin/converter/html_in.py

         for child in element:
             # We need one dt tag, and one dd tag, a have a pair
             if child.tag.name == 'dt' or child.tag.name == 'dd':
-                number_pair = number_pair + 1
+                number_pair += 1
 
             # The following code is similar to do_children method
             if isinstance(child, ET.Element):

MoinMoin/converter/moinwiki_in.py

         def add_attr_to_style(attrib, attr):
             attr = attr.strip().decode('unicode-escape')
             if not attr.endswith(';'):
-                attr = attr + ';'
+                attr += ';'
             if attrib.get(moin_page('style'), ""):
                 attrib[moin_page('style')] = attrib.get(moin_page('style'), "") + " " + attr
             else:

MoinMoin/converter/rst_out.py

                 return u"`{0}`__".format(text)
             else:
                 while text in [t for (t, h) in self.all_used_references]:
-                    text = text + u"~"
+                    text += u"~"
         self.used_references.append((text, href))
         self.all_used_references.append((text, href))
         #self.objects.append("\n\n.. _%s: %s\n\n" % (text, href))

MoinMoin/items/_tests/test_Item.py

         assert saved_data == data
 
         data = rev1_data = data * 10000
-        comment = comment + u' again'
+        comment += u' again'
         # save rev 1
         item._save(meta, data, comment=comment)
         # check save result

MoinMoin/util/__init__.py

     pattern = ','
     for i in range(len(numbers) - 1):
         if pattern[-1] == ',':
-            pattern = pattern + str(numbers[i])
+            pattern += str(numbers[i])
             if numbers[i] + 1 == numbers[i + 1]:
-                pattern = pattern + '-'
+                pattern += '-'
             else:
-                pattern = pattern + ','
+                pattern += ','
         elif numbers[i] + 1 != numbers[i + 1]:
             pattern = pattern + str(numbers[i]) + ','
 

MoinMoin/util/diff_text.py

     while i < len(lines):
         marker = lines[i][0]
         if marker == ' ':
-            count = count + 1
-            i = i + 1
-            lcount_old = lcount_old + 1
-            lcount_new = lcount_new + 1
+            count += 1
+            i += 1
+            lcount_old += 1
+            lcount_new += 1
         elif marker in ['-', '+']:
             if (count == i) and count > 3:
                 lines[:i - 3] = []
                 count = 0
                 i += 1
             if marker == '-':
-                lcount_old = lcount_old + 1
+                lcount_old += 1
             else:
-                lcount_new = lcount_new + 1
+                lcount_new += 1
         elif marker == '?':
             lines[i:i + 1] = []
 

MoinMoin/util/paramparser.py

                 continue
             idx -= 1
             if len(cur) and cur[-1]:
-                cur[-1] = cur[-1] + spaces
+                cur[-1] += spaces
         elif not quoted and char == name_value_separator:
             if multikey or len(cur) == 1:
                 cur.append(None)