diff -r 9986ec0e559a -r 10516539f238 UI/CompareDialog.py --- a/UI/CompareDialog.py Tue Oct 15 22:03:54 2013 +0200 +++ b/UI/CompareDialog.py Fri Oct 18 23:00:41 2013 +0200 @@ -4,7 +4,8 @@ # """ -Module implementing a dialog to compare two files and show the result side by side. +Module implementing a dialog to compare two files and show the result side by +side. """ from __future__ import unicode_literals # __IGNORE_WARNING__ @@ -30,7 +31,8 @@ def sbsdiff(a, b, linenumberwidth=4): """ - Compare two sequences of lines; generate the delta for display side by side. + Compare two sequences of lines; generate the delta for display side by + side. @param a first sequence of lines (list of strings) @param b second sequence of lines (list of strings) @@ -38,7 +40,8 @@ @return a generator yielding tuples of differences. The tuple is composed of strings as follows. <ul> - <li>opcode -- one of e, d, i, r for equal, delete, insert, replace</li> + <li>opcode -- one of e, d, i, r for equal, delete, insert, + replace</li> <li>lineno a -- linenumber of sequence a</li> <li>line a -- line of sequence a</li> <li>lineno b -- linenumber of sequence b</li> @@ -61,7 +64,8 @@ linenumberformat = "{{0:{0:d}d}}".format(linenumberwidth) emptylineno = ' ' * linenumberwidth - for (ln1, l1), (ln2, l2), flag in _mdiff(a, b, None, None, IS_CHARACTER_JUNK): + for (ln1, l1), (ln2, l2), flag in _mdiff(a, b, None, None, + IS_CHARACTER_JUNK): if not flag: yield ('e', linenumberformat.format(ln1), l1, linenumberformat.format(ln2), l2) @@ -80,7 +84,8 @@ class CompareDialog(QWidget, Ui_CompareDialog): """ - Class implementing a dialog to compare two files and show the result side by side. + Class implementing a dialog to compare two files and show the result side + by side. """ def __init__(self, files=[], parent=None): """ @@ -96,8 +101,8 @@ self.file1Completer = E5FileCompleter(self.file1Edit) self.file2Completer = E5FileCompleter(self.file2Edit) - self.diffButton = \ - self.buttonBox.addButton(self.trUtf8("Compare"), QDialogButtonBox.ActionRole) + self.diffButton = self.buttonBox.addButton( + self.trUtf8("Compare"), QDialogButtonBox.ActionRole) self.diffButton.setToolTip( self.trUtf8("Press to perform the comparison of the two files")) self.diffButton.setEnabled(False) @@ -228,7 +233,8 @@ except IOError: E5MessageBox.critical(self, self.trUtf8("Compare Files"), - self.trUtf8("""<p>The file <b>{0}</b> could not be read.</p>""") + self.trUtf8( + """<p>The file <b>{0}</b> could not be read.</p>""") .format(filename1)) return @@ -240,7 +246,8 @@ except IOError: E5MessageBox.critical(self, self.trUtf8("Compare Files"), - self.trUtf8("""<p>The file <b>{0}</b> could not be read.</p>""") + self.trUtf8( + """<p>The file <b>{0}</b> could not be read.</p>""") .format(filename2)) return @@ -480,7 +487,8 @@ """ super(CompareWindow, self).__init__(parent) - self.setStyle(Preferences.getUI("Style"), Preferences.getUI("StyleSheet")) + self.setStyle(Preferences.getUI("Style"), + Preferences.getUI("StyleSheet")) self.cw = CompareDialog(files, self) self.cw.installEventFilter(self)