diff -r 81326a94fdca -r 37f0444c3479 Documentation/Source/eric5.UI.DiffDialog.html --- a/Documentation/Source/eric5.UI.DiffDialog.html Thu Jan 14 17:27:31 2010 +0000 +++ b/Documentation/Source/eric5.UI.DiffDialog.html Thu Jan 14 18:35:52 2010 +0000 @@ -22,7 +22,7 @@ <body><a NAME="top" ID="top"></a> <h1>eric5.UI.DiffDialog</h1> <p> -Module implementing a dialog to compare two files. +Module implementing a dialog to compare two files. </p> <h3>Global Attributes</h3> <table> @@ -32,27 +32,27 @@ <table> <tr> <td><a href="#DiffDialog">DiffDialog</a></td> -<td>Class implementing a dialog to compare two files.</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> +<td>Main window class for the standalone dialog.</td> </tr> </table> <h3>Functions</h3> <table> <tr> <td><a href="#context_diff">context_diff</a></td> -<td>Compare two sequences of lines; generate the delta as a context diff.</td> +<td>Compare two sequences of lines; generate the delta as a context diff.</td> </tr><tr> <td><a href="#unified_diff">unified_diff</a></td> -<td>Compare two sequences of lines; generate the delta as a unified diff.</td> +<td>Compare two sequences of lines; generate the delta as a unified diff.</td> </tr> </table> <hr /><hr /> <a NAME="DiffDialog" ID="DiffDialog"></a> <h2>DiffDialog</h2> <p> - Class implementing a dialog to compare two files. + Class implementing a dialog to compare two files. </p> <h3>Derived from</h3> QWidget, Ui_DiffDialog @@ -64,168 +64,168 @@ <table> <tr> <td><a href="#DiffDialog.__init__">DiffDialog</a></td> -<td>Constructor</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> +<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> +<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> +<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> +<td>Private slot to generate a unified diff output.</td> </tr><tr> <td><a href="#DiffDialog.__selectFile">__selectFile</a></td> -<td>Private slot to display a file selection dialog.</td> +<td>Private slot to display a file selection dialog.</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> +<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> +<td>Private slot to handle the Compare button press.</td> </tr><tr> <td><a href="#DiffDialog.on_file1Button_clicked">on_file1Button_clicked</a></td> -<td>Private slot to handle the file 1 file selection button press.</td> +<td>Private slot to handle the file 1 file selection button press.</td> </tr><tr> <td><a href="#DiffDialog.on_file2Button_clicked">on_file2Button_clicked</a></td> -<td>Private slot to handle the file 2 file selection button press.</td> +<td>Private slot to handle the file 2 file selection 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> +<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> +<td>Public slot to show the dialog.</td> </tr> </table> <a NAME="DiffDialog.__init__" ID="DiffDialog.__init__"></a> <h4>DiffDialog (Constructor)</h4> <b>DiffDialog</b>(<i>parent = None</i>) <p> - Constructor + Constructor </p><a NAME="DiffDialog.__appendText" ID="DiffDialog.__appendText"></a> <h4>DiffDialog.__appendText</h4> <b>__appendText</b>(<i>txt, format</i>) <p> - Private method to append text to the end of the contents pane. + Private method to append text to the end of the contents pane. </p><dl> <dt><i>txt</i></dt> <dd> -text to insert (string) +text to insert (string) </dd><dt><i>format</i></dt> <dd> -text format to be used (QTextCharFormat) +text format to be used (QTextCharFormat) </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. + 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. + Private slot to generate a context diff output. </p><dl> <dt><i>a</i></dt> <dd> -first sequence of lines (list of strings) +first sequence of lines (list of strings) </dd><dt><i>b</i></dt> <dd> -second sequence of lines (list of strings) +second sequence of lines (list of strings) </dd><dt><i>fromfile</i></dt> <dd> -filename of the first file (string) +filename of the first file (string) </dd><dt><i>tofile</i></dt> <dd> -filename of the second file (string) +filename of the second file (string) </dd><dt><i>fromfiledate</i></dt> <dd> -modification time of the first file (string) +modification time of the first file (string) </dd><dt><i>tofiledate</i></dt> <dd> -modification time of the second file (string) +modification time of the second file (string) </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. + Private slot to generate a unified diff output. </p><dl> <dt><i>a</i></dt> <dd> -first sequence of lines (list of strings) +first sequence of lines (list of strings) </dd><dt><i>b</i></dt> <dd> -second sequence of lines (list of strings) +second sequence of lines (list of strings) </dd><dt><i>fromfile</i></dt> <dd> -filename of the first file (string) +filename of the first file (string) </dd><dt><i>tofile</i></dt> <dd> -filename of the second file (string) +filename of the second file (string) </dd><dt><i>fromfiledate</i></dt> <dd> -modification time of the first file (string) +modification time of the first file (string) </dd><dt><i>tofiledate</i></dt> <dd> -modification time of the second file (string) +modification time of the second file (string) </dd> </dl><a NAME="DiffDialog.__selectFile" ID="DiffDialog.__selectFile"></a> <h4>DiffDialog.__selectFile</h4> <b>__selectFile</b>(<i>lineEdit</i>) <p> - Private slot to display a file selection dialog. + Private slot to display a file selection dialog. </p><dl> <dt><i>lineEdit</i></dt> <dd> -field for the display of the selected filename - (QLineEdit) +field for the display of the selected filename + (QLineEdit) </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. + Private slot called by a button of the button box clicked. </p><dl> <dt><i>button</i></dt> <dd> -button that was clicked (QAbstractButton) +button that was clicked (QAbstractButton) </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. + Private slot to handle the Compare button press. </p><a NAME="DiffDialog.on_file1Button_clicked" ID="DiffDialog.on_file1Button_clicked"></a> <h4>DiffDialog.on_file1Button_clicked</h4> <b>on_file1Button_clicked</b>(<i></i>) <p> - Private slot to handle the file 1 file selection button press. + Private slot to handle the file 1 file selection button press. </p><a NAME="DiffDialog.on_file2Button_clicked" ID="DiffDialog.on_file2Button_clicked"></a> <h4>DiffDialog.on_file2Button_clicked</h4> <b>on_file2Button_clicked</b>(<i></i>) <p> - Private slot to handle the file 2 file selection button press. + Private slot to handle the file 2 file selection 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. + 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. + 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. + Public slot to show the dialog. </p><dl> <dt><i>filename</i></dt> <dd> -name of a file to use as the first file (string) +name of a file to use as the first file (string) </dd> </dl> <div align="right"><a href="#top">Up</a></div> @@ -233,7 +233,7 @@ <a NAME="DiffWindow" ID="DiffWindow"></a> <h2>DiffWindow</h2> <p> - Main window class for the standalone dialog. + Main window class for the standalone dialog. </p> <h3>Derived from</h3> QMainWindow @@ -245,39 +245,39 @@ <table> <tr> <td><a href="#DiffWindow.__init__">DiffWindow</a></td> -<td>Constructor</td> +<td>Constructor</td> </tr><tr> <td><a href="#DiffWindow.eventFilter">eventFilter</a></td> -<td>Public method to filter events.</td> +<td>Public method to filter events.</td> </tr> </table> <a NAME="DiffWindow.__init__" ID="DiffWindow.__init__"></a> <h4>DiffWindow (Constructor)</h4> <b>DiffWindow</b>(<i>parent = None</i>) <p> - Constructor + Constructor </p><dl> <dt><i>parent</i></dt> <dd> -reference to the parent widget (QWidget) +reference to the parent widget (QWidget) </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. + Public method to filter events. </p><dl> <dt><i>obj</i></dt> <dd> -reference to the object the event is meant for (QObject) +reference to the object the event is meant for (QObject) </dd><dt><i>event</i></dt> <dd> -reference to the event object (QEvent) +reference to the event object (QEvent) </dd> </dl><dl> <dt>Returns:</dt> <dd> -flag indicating, whether the event was handled (boolean) +flag indicating, whether the event was handled (boolean) </dd> </dl> <div align="right"><a href="#top">Up</a></div> @@ -286,77 +286,77 @@ <h2>context_diff</h2> <b>context_diff</b>(<i>a, b, fromfile='', tofile='', fromfiledate='', tofiledate='', n=3, lineterm='\n'</i>) <p> - Compare two sequences of lines; generate the delta as a context diff. + Compare two sequences of lines; generate the delta as a context diff. </p><p> - Context diffs are a compact way of showing line changes and a few - lines of context. The number of context lines is set by 'n' which - defaults to three. + Context diffs are a compact way of showing line changes and a few + lines of context. The number of context lines is set by 'n' which + defaults to three. </p><p> - By default, the diff control lines (those with *** or ---) are - created with a trailing newline. This is helpful so that inputs - created from file.readlines() result in diffs that are suitable for - file.writelines() since both the inputs and outputs have trailing - newlines. + By default, the diff control lines (those with *** or ---) are + created with a trailing newline. This is helpful so that inputs + created from file.readlines() result in diffs that are suitable for + file.writelines() since both the inputs and outputs have trailing + newlines. </p><p> - For inputs that do not have trailing newlines, set the lineterm - argument to "" so that the output will be uniformly newline free. + For inputs that do not have trailing newlines, set the lineterm + argument to "" so that the output will be uniformly newline free. </p><p> - The context diff format normally has a header for filenames and - modification times. Any or all of these may be specified using - strings for 'fromfile', 'tofile', 'fromfiledate', and 'tofiledate'. - The modification times are normally expressed in the format returned - by time.ctime(). If not specified, the strings default to blanks. + The context diff format normally has a header for filenames and + modification times. Any or all of these may be specified using + strings for 'fromfile', 'tofile', 'fromfiledate', and 'tofiledate'. + The modification times are normally expressed in the format returned + by time.ctime(). If not specified, the strings default to blanks. </p><p> - Example: + Example: </p><p> - <pre> - &gt;&gt;&gt; print ''.join(context_diff('one\ntwo\nthree\nfour\n'.splitlines(1), - ... 'zero\none\ntree\nfour\n'.splitlines(1), 'Original', 'Current', - ... 'Sat Jan 26 23:30:50 1991', 'Fri Jun 06 10:22:46 2003')), - *** Original Sat Jan 26 23:30:50 1991 - --- Current Fri Jun 06 10:22:46 2003 + <pre> + >>> print ''.join(context_diff('one\ntwo\nthree\nfour\n'.splitlines(1), + ... 'zero\none\ntree\nfour\n'.splitlines(1), 'Original', 'Current', + ... 'Sat Jan 26 23:30:50 1991', 'Fri Jun 06 10:22:46 2003')), + *** Original Sat Jan 26 23:30:50 1991 + --- Current Fri Jun 06 10:22:46 2003 *************** - *** 1,4 **** - one - ! two - ! three - four - --- 1,4 ---- - + zero - one - ! tree - four - </pre> + *** 1,4 **** + one + ! two + ! three + four + --- 1,4 ---- + + zero + one + ! tree + four + </pre> </p><dl> <dt><i>a</i></dt> <dd> -first sequence of lines (list of strings) +first sequence of lines (list of strings) </dd><dt><i>b</i></dt> <dd> -second sequence of lines (list of strings) +second sequence of lines (list of strings) </dd><dt><i>fromfile</i></dt> <dd> -filename of the first file (string) +filename of the first file (string) </dd><dt><i>tofile</i></dt> <dd> -filename of the second file (string) +filename of the second file (string) </dd><dt><i>fromfiledate</i></dt> <dd> -modification time of the first file (string) +modification time of the first file (string) </dd><dt><i>tofiledate</i></dt> <dd> -modification time of the second file (string) +modification time of the second file (string) </dd><dt><i>n</i></dt> <dd> -number of lines of context (integer) +number of lines of context (integer) </dd><dt><i>lineterm</i></dt> <dd> -line termination string (string) +line termination string (string) </dd> </dl><dl> <dt>Returns:</dt> <dd> -a generator yielding lines of differences +a generator yielding lines of differences </dd> </dl> <div align="right"><a href="#top">Up</a></div> @@ -365,74 +365,74 @@ <h2>unified_diff</h2> <b>unified_diff</b>(<i>a, b, fromfile='', tofile='', fromfiledate='', tofiledate='', n=3, lineterm='\n'</i>) <p> - Compare two sequences of lines; generate the delta as a unified diff. + Compare two sequences of lines; generate the delta as a unified diff. </p><p> - Unified diffs are a compact way of showing line changes and a few - lines of context. The number of context lines is set by 'n' which - defaults to three. + Unified diffs are a compact way of showing line changes and a few + lines of context. The number of context lines is set by 'n' which + defaults to three. </p><p> - By default, the diff control lines (those with ---, +++, or @@) are - created with a trailing newline. This is helpful so that inputs - created from file.readlines() result in diffs that are suitable for - file.writelines() since both the inputs and outputs have trailing - newlines. + By default, the diff control lines (those with ---, +++, or @@) are + created with a trailing newline. This is helpful so that inputs + created from file.readlines() result in diffs that are suitable for + file.writelines() since both the inputs and outputs have trailing + newlines. </p><p> - For inputs that do not have trailing newlines, set the lineterm - argument to "" so that the output will be uniformly newline free. + For inputs that do not have trailing newlines, set the lineterm + argument to "" so that the output will be uniformly newline free. </p><p> - The unidiff format normally has a header for filenames and modification - times. Any or all of these may be specified using strings for - 'fromfile', 'tofile', 'fromfiledate', and 'tofiledate'. The modification - times are normally expressed in the format returned by time.ctime(). + The unidiff format normally has a header for filenames and modification + times. Any or all of these may be specified using strings for + 'fromfile', 'tofile', 'fromfiledate', and 'tofiledate'. The modification + times are normally expressed in the format returned by time.ctime(). </p><p> - Example: + Example: </p><p> - <pre> - &gt;&gt;&gt; for line in unified_diff('one two three four'.split(), - ... 'zero one tree four'.split(), 'Original', 'Current', - ... 'Sat Jan 26 23:30:50 1991', 'Fri Jun 06 10:20:52 2003', - ... lineterm=''): - ... print line - --- Original Sat Jan 26 23:30:50 1991 - +++ Current Fri Jun 06 10:20:52 2003 -@ -1,4 +1,4 @@ - +zero - one - -two - -three - +tree - four - </pre> + <pre> + >>> for line in unified_diff('one two three four'.split(), + ... 'zero one tree four'.split(), 'Original', 'Current', + ... 'Sat Jan 26 23:30:50 1991', 'Fri Jun 06 10:20:52 2003', + ... lineterm=''): + ... print line + --- Original Sat Jan 26 23:30:50 1991 + +++ Current Fri Jun 06 10:20:52 2003 +@ -1,4 +1,4 @@ + +zero + one + -two + -three + +tree + four + </pre> </p><dl> <dt><i>a</i></dt> <dd> -first sequence of lines (list of strings) +first sequence of lines (list of strings) </dd><dt><i>b</i></dt> <dd> -second sequence of lines (list of strings) +second sequence of lines (list of strings) </dd><dt><i>fromfile</i></dt> <dd> -filename of the first file (string) +filename of the first file (string) </dd><dt><i>tofile</i></dt> <dd> -filename of the second file (string) +filename of the second file (string) </dd><dt><i>fromfiledate</i></dt> <dd> -modification time of the first file (string) +modification time of the first file (string) </dd><dt><i>tofiledate</i></dt> <dd> -modification time of the second file (string) +modification time of the second file (string) </dd><dt><i>n</i></dt> <dd> -number of lines of context (integer) +number of lines of context (integer) </dd><dt><i>lineterm</i></dt> <dd> -line termination string (string) +line termination string (string) </dd> </dl><dl> <dt>Returns:</dt> <dd> -a generator yielding lines of differences +a generator yielding lines of differences </dd> </dl> <div align="right"><a href="#top">Up</a></div>