UI/CompareDialog.py

branch
Py2 comp.
changeset 3060
5883ce99ee12
parent 3058
0a02c433f52d
parent 3039
8dd0165d805d
child 3141
72f3bde98c58
--- a/UI/CompareDialog.py	Fri Nov 01 15:48:48 2013 +0100
+++ b/UI/CompareDialog.py	Sun Nov 03 15:58:22 2013 +0100
@@ -68,18 +68,18 @@
                                              IS_CHARACTER_JUNK):
         if not flag:
             yield ('e', linenumberformat.format(ln1), l1,
-                        linenumberformat.format(ln2), l2)
+                   linenumberformat.format(ln2), l2)
             continue
         if ln2 == "" and l2 == "\n":
             yield ('d', linenumberformat.format(ln1), removeMarkers(l1),
-                        emptylineno, '\n')
+                   emptylineno, '\n')
             continue
         if ln1 == "" and l1 == "\n":
             yield ('i', emptylineno, '\n',
-                        linenumberformat.format(ln2), removeMarkers(l2))
+                   linenumberformat.format(ln2), removeMarkers(l2))
             continue
         yield ('r', linenumberformat.format(ln1), l1,
-                    linenumberformat.format(ln2), l2)
+               linenumberformat.format(ln2), l2)
 
 
 class CompareDialog(QWidget, Ui_CompareDialog):
@@ -236,7 +236,7 @@
                 self.trUtf8("Compare Files"),
                 self.trUtf8(
                     """<p>The file <b>{0}</b> could not be read.</p>""")
-                    .format(filename1))
+                .format(filename1))
             return
 
         filename2 = Utilities.toNativeSeparators(self.file2Edit.text())
@@ -250,7 +250,7 @@
                 self.trUtf8("Compare Files"),
                 self.trUtf8(
                     """<p>The file <b>{0}</b> could not be read.</p>""")
-                    .format(filename2))
+                .format(filename2))
             return
         
         self.__compare(lines1, lines2)
@@ -276,9 +276,9 @@
         self.diffButton.setEnabled(False)
         self.diffButton.hide()
         
-        if type(lines1) == type(""):
+        if isinstance(lines1, str):
             lines1 = lines1.splitlines(True)
-        if type(lines2) == type(""):
+        if isinstance(lines2, str):
             lines2 = lines2.splitlines(True)
         
         self.__compare(lines1, lines2)
@@ -344,13 +344,13 @@
         self.firstButton.setEnabled(False)
         self.upButton.setEnabled(False)
         self.downButton.setEnabled(
-            len(self.diffParas) > 0 and 
+            len(self.diffParas) > 0 and
             (self.vsb1.isVisible() or self.vsb2.isVisible()))
         self.lastButton.setEnabled(
-            len(self.diffParas) > 0 and 
+            len(self.diffParas) > 0 and
             (self.vsb1.isVisible() or self.vsb2.isVisible()))
         
-        self.totalLabel.setText(self.trUtf8('Total: {0}')\
+        self.totalLabel.setText(self.trUtf8('Total: {0}')
                                     .format(added + deleted + changed))
         self.changedLabel.setText(self.trUtf8('Changed: {0}').format(changed))
         self.addedLabel.setText(self.trUtf8('Added: {0}').format(added))

eric ide

mercurial