changeset 2008:cb2ca948f94b

use augmented assignments
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 17 Feb 2013 17:51:55 +0100
parents 0fdfd6a34406
children 093bdc2d6fe0
files MoinMoin/converter/docbook_in.py MoinMoin/converter/docbook_out.py MoinMoin/converter/html_in.py MoinMoin/converter/moinwiki_in.py MoinMoin/converter/rst_out.py MoinMoin/items/_tests/test_Item.py MoinMoin/util/__init__.py MoinMoin/util/diff_text.py MoinMoin/util/paramparser.py
diffstat 9 files changed, 19 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/converter/docbook_in.py	Sun Feb 17 17:38:17 2013 +0100
+++ b/MoinMoin/converter/docbook_in.py	Sun Feb 17 17:51:55 2013 +0100
@@ -249,7 +249,7 @@
         a given element.
         """
         new_children = []
-        depth = depth + 1
+        depth += 1
         for child in element:
             if isinstance(child, ET.Element):
                 r = self.visit(child, depth)
@@ -744,8 +744,8 @@
         """
         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
@@ -789,7 +789,7 @@
                             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:
--- a/MoinMoin/converter/docbook_out.py	Sun Feb 17 17:38:17 2013 +0100
+++ b/MoinMoin/converter/docbook_out.py	Sun Feb 17 17:51:55 2013 +0100
@@ -385,7 +385,7 @@
         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))
--- a/MoinMoin/converter/html_in.py	Sun Feb 17 17:38:17 2013 +0100
+++ b/MoinMoin/converter/html_in.py	Sun Feb 17 17:51:55 2013 +0100
@@ -481,7 +481,7 @@
         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):
--- a/MoinMoin/converter/moinwiki_in.py	Sun Feb 17 17:38:17 2013 +0100
+++ b/MoinMoin/converter/moinwiki_in.py	Sun Feb 17 17:51:55 2013 +0100
@@ -888,7 +888,7 @@
         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:
--- a/MoinMoin/converter/rst_out.py	Sun Feb 17 17:38:17 2013 +0100
+++ b/MoinMoin/converter/rst_out.py	Sun Feb 17 17:51:55 2013 +0100
@@ -386,7 +386,7 @@
                 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))
--- a/MoinMoin/items/_tests/test_Item.py	Sun Feb 17 17:38:17 2013 +0100
+++ b/MoinMoin/items/_tests/test_Item.py	Sun Feb 17 17:51:55 2013 +0100
@@ -66,7 +66,7 @@
         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
--- a/MoinMoin/util/__init__.py	Sun Feb 17 17:38:17 2013 +0100
+++ b/MoinMoin/util/__init__.py	Sun Feb 17 17:51:55 2013 +0100
@@ -72,11 +72,11 @@
     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]) + ','
 
--- a/MoinMoin/util/diff_text.py	Sun Feb 17 17:38:17 2013 +0100
+++ b/MoinMoin/util/diff_text.py	Sun Feb 17 17:51:55 2013 +0100
@@ -49,10 +49,10 @@
     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] = []
@@ -67,9 +67,9 @@
                 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] = []
 
--- a/MoinMoin/util/paramparser.py	Sun Feb 17 17:38:17 2013 +0100
+++ b/MoinMoin/util/paramparser.py	Sun Feb 17 17:51:55 2013 +0100
@@ -182,7 +182,7 @@
                 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)