eric4.UI.CompareDialog

Module implementing a dialog to compare two files and show the result side by side.

Classes

CompareDialog Class implementing a dialog to compare two files and show the result side by side.

Functions

sbsdiff Compare two sequences of lines; generate the delta for display side by side.


CompareDialog

Class implementing a dialog to compare two files and show the result side by side.

Derived from

QWidget, Ui_CompareDialog

Methods

CompareDialog Constructor
__appendText Private method to append text to the end of the contents pane.
__fileChanged Private slot to enable/disable the Compare button.
__selectFile Private slot to display a file selection dialog.
on_diffButton_clicked Private slot to handle the Compare button press.
on_file1Button_clicked Private slot to handle the file 1 file selection button press.
on_file2Button_clicked Private slot to handle the file 2 file selection button press.
on_synchronizeCheckBox_toggled Private slot to connect or disconnect the scrollbars of the displays.

CompareDialog (Constructor)

CompareDialog(parent = None)

Constructor

parent
parent widget (QWidget)

CompareDialog.__appendText

__appendText(pane, txt, format)

Private method to append text to the end of the contents pane.

pane
text edit widget to append text to (QTextedit)
txt
text to insert (QString)
format
text format to be used (QTextCharFormat)

CompareDialog.__fileChanged

__fileChanged()

Private slot to enable/disable the Compare button.

CompareDialog.__selectFile

__selectFile(lineEdit)

Private slot to display a file selection dialog.

lineEdit
field for the display of the selected filename (QLineEdit)

CompareDialog.on_diffButton_clicked

on_diffButton_clicked()

Private slot to handle the Compare button press.

CompareDialog.on_file1Button_clicked

on_file1Button_clicked()

Private slot to handle the file 1 file selection button press.

CompareDialog.on_file2Button_clicked

on_file2Button_clicked()

Private slot to handle the file 2 file selection button press.

CompareDialog.on_synchronizeCheckBox_toggled

on_synchronizeCheckBox_toggled(sync)

Private slot to connect or disconnect the scrollbars of the displays.

sync
flag indicating synchronisation status (boolean)

Up


sbsdiff

sbsdiff(a, b, linenumberwidth = 4)

Compare two sequences of lines; generate the delta for display side by side.

a
first sequence of lines (list of strings)
b
second sequence of lines (list of strings)
linenumberwidth
width (in characters) of the linenumbers (integer)
Returns:
a generator yielding tuples of differences. The tuple is composed of strings as follows.
Up