Sat, 26 Apr 2025 12:34:32 +0200
MicroPython
- Added a configuration option to disable the support for the no longer produced Pimoroni Pico Wireless Pack.
<!DOCTYPE html> <html><head> <title>eric7.UI.DiffDialog</title> <meta charset="UTF-8"> <link rel="stylesheet" href="styles.css"> </head> <body> <a NAME="top" ID="top"></a> <h1>eric7.UI.DiffDialog</h1> <p> Module implementing a dialog to compare two files. </p> <h3>Global Attributes</h3> <table> <tr><td>None</td></tr> </table> <h3>Classes</h3> <table> <tr> <td><a href="#DiffDialog">DiffDialog</a></td> <td>Class implementing a dialog to compare two files.</td> </tr> <tr> <td><a href="#DiffWindow">DiffWindow</a></td> <td>Main window class for the standalone dialog.</td> </tr> </table> <h3>Functions</h3> <table> <tr><td>None</td></tr> </table> <hr /> <hr /> <a NAME="DiffDialog" ID="DiffDialog"></a> <h2>DiffDialog</h2> <p> Class implementing a dialog to compare two files. </p> <h3>Derived from</h3> QWidget, Ui_DiffDialog <h3>Class Attributes</h3> <table> <tr><td>None</td></tr> </table> <h3>Class Methods</h3> <table> <tr><td>None</td></tr> </table> <h3>Methods</h3> <table> <tr> <td><a href="#DiffDialog.__init__">DiffDialog</a></td> <td>Constructor</td> </tr> <tr> <td><a href="#DiffDialog.__appendText">__appendText</a></td> <td>Private method to append text to the end of the contents pane.</td> </tr> <tr> <td><a href="#DiffDialog.__fileChanged">__fileChanged</a></td> <td>Private slot to enable/disable the Compare button.</td> </tr> <tr> <td><a href="#DiffDialog.__generateContextDiff">__generateContextDiff</a></td> <td>Private slot to generate a context diff output.</td> </tr> <tr> <td><a href="#DiffDialog.__generateUnifiedDiff">__generateUnifiedDiff</a></td> <td>Private slot to generate a unified diff output.</td> </tr> <tr> <td><a href="#DiffDialog.on_buttonBox_clicked">on_buttonBox_clicked</a></td> <td>Private slot called by a button of the button box clicked.</td> </tr> <tr> <td><a href="#DiffDialog.on_diffButton_clicked">on_diffButton_clicked</a></td> <td>Private slot to handle the Compare button press.</td> </tr> <tr> <td><a href="#DiffDialog.on_saveButton_clicked">on_saveButton_clicked</a></td> <td>Private slot to handle the Save button press.</td> </tr> <tr> <td><a href="#DiffDialog.show">show</a></td> <td>Public slot to show the dialog.</td> </tr> </table> <h3>Static Methods</h3> <table> <tr><td>None</td></tr> </table> <a NAME="DiffDialog.__init__" ID="DiffDialog.__init__"></a> <h4>DiffDialog (Constructor)</h4> <b>DiffDialog</b>(<i>files=None, parent=None</i>) <p> Constructor </p> <dl> <dt><i>files</i> (list of [str, str])</dt> <dd> list of two file names to be diffed </dd> <dt><i>parent</i> (QWidget)</dt> <dd> reference to the parent widget </dd> </dl> <a NAME="DiffDialog.__appendText" ID="DiffDialog.__appendText"></a> <h4>DiffDialog.__appendText</h4> <b>__appendText</b>(<i>txt</i>) <p> Private method to append text to the end of the contents pane. </p> <dl> <dt><i>txt</i> (str)</dt> <dd> text to insert </dd> </dl> <a NAME="DiffDialog.__fileChanged" ID="DiffDialog.__fileChanged"></a> <h4>DiffDialog.__fileChanged</h4> <b>__fileChanged</b>(<i></i>) <p> Private slot to enable/disable the Compare button. </p> <a NAME="DiffDialog.__generateContextDiff" ID="DiffDialog.__generateContextDiff"></a> <h4>DiffDialog.__generateContextDiff</h4> <b>__generateContextDiff</b>(<i>a, b, fromfile, tofile, fromfiledate, tofiledate</i>) <p> Private slot to generate a context diff output. </p> <dl> <dt><i>a</i> (list of str)</dt> <dd> first sequence of lines </dd> <dt><i>b</i> (list of str)</dt> <dd> second sequence of lines </dd> <dt><i>fromfile</i> (str)</dt> <dd> filename of the first file </dd> <dt><i>tofile</i> (str)</dt> <dd> filename of the second file </dd> <dt><i>fromfiledate</i> (str)</dt> <dd> modification time of the first file </dd> <dt><i>tofiledate</i> (str)</dt> <dd> modification time of the second file </dd> </dl> <a NAME="DiffDialog.__generateUnifiedDiff" ID="DiffDialog.__generateUnifiedDiff"></a> <h4>DiffDialog.__generateUnifiedDiff</h4> <b>__generateUnifiedDiff</b>(<i>a, b, fromfile, tofile, fromfiledate, tofiledate</i>) <p> Private slot to generate a unified diff output. </p> <dl> <dt><i>a</i> (list of str)</dt> <dd> first sequence of lines </dd> <dt><i>b</i> (list of str)</dt> <dd> second sequence of lines </dd> <dt><i>fromfile</i> (str)</dt> <dd> filename of the first file </dd> <dt><i>tofile</i> (str)</dt> <dd> filename of the second file </dd> <dt><i>fromfiledate</i> (str)</dt> <dd> modification time of the first file </dd> <dt><i>tofiledate</i> (str)</dt> <dd> modification time of the second file </dd> </dl> <a NAME="DiffDialog.on_buttonBox_clicked" ID="DiffDialog.on_buttonBox_clicked"></a> <h4>DiffDialog.on_buttonBox_clicked</h4> <b>on_buttonBox_clicked</b>(<i>button</i>) <p> Private slot called by a button of the button box clicked. </p> <dl> <dt><i>button</i> (QAbstractButton)</dt> <dd> button that was clicked </dd> </dl> <a NAME="DiffDialog.on_diffButton_clicked" ID="DiffDialog.on_diffButton_clicked"></a> <h4>DiffDialog.on_diffButton_clicked</h4> <b>on_diffButton_clicked</b>(<i></i>) <p> Private slot to handle the Compare button press. </p> <a NAME="DiffDialog.on_saveButton_clicked" ID="DiffDialog.on_saveButton_clicked"></a> <h4>DiffDialog.on_saveButton_clicked</h4> <b>on_saveButton_clicked</b>(<i></i>) <p> Private slot to handle the Save button press. </p> <p> It saves the diff shown in the dialog to a file in the local filesystem. </p> <a NAME="DiffDialog.show" ID="DiffDialog.show"></a> <h4>DiffDialog.show</h4> <b>show</b>(<i>filename=None</i>) <p> Public slot to show the dialog. </p> <dl> <dt><i>filename</i> (str)</dt> <dd> name of a file to use as the first file </dd> </dl> <div align="right"><a href="#top">Up</a></div> <hr /> <hr /> <a NAME="DiffWindow" ID="DiffWindow"></a> <h2>DiffWindow</h2> <p> Main window class for the standalone dialog. </p> <h3>Derived from</h3> EricMainWindow <h3>Class Attributes</h3> <table> <tr><td>None</td></tr> </table> <h3>Class Methods</h3> <table> <tr><td>None</td></tr> </table> <h3>Methods</h3> <table> <tr> <td><a href="#DiffWindow.__init__">DiffWindow</a></td> <td>Constructor</td> </tr> <tr> <td><a href="#DiffWindow.eventFilter">eventFilter</a></td> <td>Public method to filter events.</td> </tr> </table> <h3>Static Methods</h3> <table> <tr><td>None</td></tr> </table> <a NAME="DiffWindow.__init__" ID="DiffWindow.__init__"></a> <h4>DiffWindow (Constructor)</h4> <b>DiffWindow</b>(<i>files=None, parent=None</i>) <p> Constructor </p> <dl> <dt><i>files</i> (list of [str, str])</dt> <dd> list of two file names to be diffed </dd> <dt><i>parent</i> (QWidget)</dt> <dd> reference to the parent widget </dd> </dl> <a NAME="DiffWindow.eventFilter" ID="DiffWindow.eventFilter"></a> <h4>DiffWindow.eventFilter</h4> <b>eventFilter</b>(<i>_obj, event</i>) <p> Public method to filter events. </p> <dl> <dt><i>_obj</i> (QObject)</dt> <dd> reference to the object the event is meant for (unused) </dd> <dt><i>event</i> (QEvent)</dt> <dd> reference to the event object </dd> </dl> <dl> <dt>Return:</dt> <dd> flag indicating, whether the event was handled </dd> </dl> <dl> <dt>Return Type:</dt> <dd> bool </dd> </dl> <div align="right"><a href="#top">Up</a></div> <hr /> </body></html>