Documentation/Source/eric5.UI.DiffDialog.html

changeset 58
37f0444c3479
parent 21
b88a0e6268bd
child 409
0ea528e80202
equal deleted inserted replaced
57:81326a94fdca 58:37f0444c3479
20 </style> 20 </style>
21 </head> 21 </head>
22 <body><a NAME="top" ID="top"></a> 22 <body><a NAME="top" ID="top"></a>
23 <h1>eric5.UI.DiffDialog</h1> 23 <h1>eric5.UI.DiffDialog</h1>
24 <p> 24 <p>
25 &#77;&#111;&#100;&#117;&#108;&#101; &#105;&#109;&#112;&#108;&#101;&#109;&#101;&#110;&#116;&#105;&#110;&#103; &#97; &#100;&#105;&#97;&#108;&#111;&#103; &#116;&#111; &#99;&#111;&#109;&#112;&#97;&#114;&#101; &#116;w&#111; &#102;&#105;&#108;&#101;&#115;. 25 Module implementing a dialog to compare two files.
26 </p> 26 </p>
27 <h3>Global Attributes</h3> 27 <h3>Global Attributes</h3>
28 <table> 28 <table>
29 <tr><td>None</td></tr> 29 <tr><td>None</td></tr>
30 </table> 30 </table>
31 <h3>Classes</h3> 31 <h3>Classes</h3>
32 <table> 32 <table>
33 <tr> 33 <tr>
34 <td><a href="#DiffDialog">DiffDialog</a></td> 34 <td><a href="#DiffDialog">DiffDialog</a></td>
35 <td>&#67;&#108;&#97;&#115;&#115; &#105;&#109;&#112;&#108;&#101;&#109;&#101;&#110;&#116;&#105;&#110;&#103; &#97; &#100;&#105;&#97;&#108;&#111;&#103; &#116;&#111; &#99;&#111;&#109;&#112;&#97;&#114;&#101; &#116;w&#111; &#102;&#105;&#108;&#101;&#115;.</td> 35 <td>Class implementing a dialog to compare two files.</td>
36 </tr><tr> 36 </tr><tr>
37 <td><a href="#DiffWindow">DiffWindow</a></td> 37 <td><a href="#DiffWindow">DiffWindow</a></td>
38 <td>&#77;&#97;&#105;&#110; w&#105;&#110;&#100;&#111;w &#99;&#108;&#97;&#115;&#115; &#102;&#111;&#114; &#116;&#104;&#101; &#115;&#116;&#97;&#110;&#100;&#97;&#108;&#111;&#110;&#101; &#100;&#105;&#97;&#108;&#111;&#103;.</td> 38 <td>Main window class for the standalone dialog.</td>
39 </tr> 39 </tr>
40 </table> 40 </table>
41 <h3>Functions</h3> 41 <h3>Functions</h3>
42 <table> 42 <table>
43 <tr> 43 <tr>
44 <td><a href="#context_diff">context_diff</a></td> 44 <td><a href="#context_diff">context_diff</a></td>
45 <td>&#67;&#111;&#109;&#112;&#97;&#114;&#101; &#116;w&#111; &#115;&#101;&#113;&#117;&#101;&#110;&#99;&#101;&#115; &#111;&#102; &#108;&#105;&#110;&#101;&#115;&#59; &#103;&#101;&#110;&#101;&#114;&#97;&#116;&#101; &#116;&#104;&#101; &#100;&#101;&#108;&#116;&#97; &#97;&#115; &#97; &#99;&#111;&#110;&#116;&#101;x&#116; &#100;&#105;&#102;&#102;.</td> 45 <td>Compare two sequences of lines; generate the delta as a context diff.</td>
46 </tr><tr> 46 </tr><tr>
47 <td><a href="#unified_diff">unified_diff</a></td> 47 <td><a href="#unified_diff">unified_diff</a></td>
48 <td>&#67;&#111;&#109;&#112;&#97;&#114;&#101; &#116;w&#111; &#115;&#101;&#113;&#117;&#101;&#110;&#99;&#101;&#115; &#111;&#102; &#108;&#105;&#110;&#101;&#115;&#59; &#103;&#101;&#110;&#101;&#114;&#97;&#116;&#101; &#116;&#104;&#101; &#100;&#101;&#108;&#116;&#97; &#97;&#115; &#97; &#117;&#110;&#105;&#102;&#105;&#101;&#100; &#100;&#105;&#102;&#102;.</td> 48 <td>Compare two sequences of lines; generate the delta as a unified diff.</td>
49 </tr> 49 </tr>
50 </table> 50 </table>
51 <hr /><hr /> 51 <hr /><hr />
52 <a NAME="DiffDialog" ID="DiffDialog"></a> 52 <a NAME="DiffDialog" ID="DiffDialog"></a>
53 <h2>DiffDialog</h2> 53 <h2>DiffDialog</h2>
54 <p> 54 <p>
55 &#67;&#108;&#97;&#115;&#115; &#105;&#109;&#112;&#108;&#101;&#109;&#101;&#110;&#116;&#105;&#110;&#103; &#97; &#100;&#105;&#97;&#108;&#111;&#103; &#116;&#111; &#99;&#111;&#109;&#112;&#97;&#114;&#101; &#116;w&#111; &#102;&#105;&#108;&#101;&#115;. 55 Class implementing a dialog to compare two files.
56 </p> 56 </p>
57 <h3>Derived from</h3> 57 <h3>Derived from</h3>
58 QWidget, Ui_DiffDialog 58 QWidget, Ui_DiffDialog
59 <h3>Class Attributes</h3> 59 <h3>Class Attributes</h3>
60 <table> 60 <table>
62 </table> 62 </table>
63 <h3>Methods</h3> 63 <h3>Methods</h3>
64 <table> 64 <table>
65 <tr> 65 <tr>
66 <td><a href="#DiffDialog.__init__">DiffDialog</a></td> 66 <td><a href="#DiffDialog.__init__">DiffDialog</a></td>
67 <td>&#67;&#111;&#110;&#115;&#116;&#114;&#117;&#99;&#116;&#111;&#114;</td> 67 <td>Constructor</td>
68 </tr><tr> 68 </tr><tr>
69 <td><a href="#DiffDialog.__appendText">__appendText</a></td> 69 <td><a href="#DiffDialog.__appendText">__appendText</a></td>
70 <td>&#80;&#114;&#105;v&#97;&#116;&#101; &#109;&#101;&#116;&#104;&#111;&#100; &#116;&#111; &#97;&#112;&#112;&#101;&#110;&#100; &#116;&#101;x&#116; &#116;&#111; &#116;&#104;&#101; &#101;&#110;&#100; &#111;&#102; &#116;&#104;&#101; &#99;&#111;&#110;&#116;&#101;&#110;&#116;&#115; &#112;&#97;&#110;&#101;.</td> 70 <td>Private method to append text to the end of the contents pane.</td>
71 </tr><tr> 71 </tr><tr>
72 <td><a href="#DiffDialog.__fileChanged">__fileChanged</a></td> 72 <td><a href="#DiffDialog.__fileChanged">__fileChanged</a></td>
73 <td>&#80;&#114;&#105;v&#97;&#116;&#101; &#115;&#108;&#111;&#116; &#116;&#111; &#101;&#110;&#97;&#98;&#108;&#101;/&#100;&#105;&#115;&#97;&#98;&#108;&#101; &#116;&#104;&#101; &#67;&#111;&#109;&#112;&#97;&#114;&#101; &#98;&#117;&#116;&#116;&#111;&#110;.</td> 73 <td>Private slot to enable/disable the Compare button.</td>
74 </tr><tr> 74 </tr><tr>
75 <td><a href="#DiffDialog.__generateContextDiff">__generateContextDiff</a></td> 75 <td><a href="#DiffDialog.__generateContextDiff">__generateContextDiff</a></td>
76 <td>&#80;&#114;&#105;v&#97;&#116;&#101; &#115;&#108;&#111;&#116; &#116;&#111; &#103;&#101;&#110;&#101;&#114;&#97;&#116;&#101; &#97; &#99;&#111;&#110;&#116;&#101;x&#116; &#100;&#105;&#102;&#102; &#111;&#117;&#116;&#112;&#117;&#116;.</td> 76 <td>Private slot to generate a context diff output.</td>
77 </tr><tr> 77 </tr><tr>
78 <td><a href="#DiffDialog.__generateUnifiedDiff">__generateUnifiedDiff</a></td> 78 <td><a href="#DiffDialog.__generateUnifiedDiff">__generateUnifiedDiff</a></td>
79 <td>&#80;&#114;&#105;v&#97;&#116;&#101; &#115;&#108;&#111;&#116; &#116;&#111; &#103;&#101;&#110;&#101;&#114;&#97;&#116;&#101; &#97; &#117;&#110;&#105;&#102;&#105;&#101;&#100; &#100;&#105;&#102;&#102; &#111;&#117;&#116;&#112;&#117;&#116;.</td> 79 <td>Private slot to generate a unified diff output.</td>
80 </tr><tr> 80 </tr><tr>
81 <td><a href="#DiffDialog.__selectFile">__selectFile</a></td> 81 <td><a href="#DiffDialog.__selectFile">__selectFile</a></td>
82 <td>&#80;&#114;&#105;v&#97;&#116;&#101; &#115;&#108;&#111;&#116; &#116;&#111; &#100;&#105;&#115;&#112;&#108;&#97;y &#97; &#102;&#105;&#108;&#101; &#115;&#101;&#108;&#101;&#99;&#116;&#105;&#111;&#110; &#100;&#105;&#97;&#108;&#111;&#103;.</td> 82 <td>Private slot to display a file selection dialog.</td>
83 </tr><tr> 83 </tr><tr>
84 <td><a href="#DiffDialog.on_buttonBox_clicked">on_buttonBox_clicked</a></td> 84 <td><a href="#DiffDialog.on_buttonBox_clicked">on_buttonBox_clicked</a></td>
85 <td>&#80;&#114;&#105;v&#97;&#116;&#101; &#115;&#108;&#111;&#116; &#99;&#97;&#108;&#108;&#101;&#100; &#98;y &#97; &#98;&#117;&#116;&#116;&#111;&#110; &#111;&#102; &#116;&#104;&#101; &#98;&#117;&#116;&#116;&#111;&#110; &#98;&#111;x &#99;&#108;&#105;&#99;&#107;&#101;&#100;.</td> 85 <td>Private slot called by a button of the button box clicked.</td>
86 </tr><tr> 86 </tr><tr>
87 <td><a href="#DiffDialog.on_diffButton_clicked">on_diffButton_clicked</a></td> 87 <td><a href="#DiffDialog.on_diffButton_clicked">on_diffButton_clicked</a></td>
88 <td>&#80;&#114;&#105;v&#97;&#116;&#101; &#115;&#108;&#111;&#116; &#116;&#111; &#104;&#97;&#110;&#100;&#108;&#101; &#116;&#104;&#101; &#67;&#111;&#109;&#112;&#97;&#114;&#101; &#98;&#117;&#116;&#116;&#111;&#110; &#112;&#114;&#101;&#115;&#115;.</td> 88 <td>Private slot to handle the Compare button press.</td>
89 </tr><tr> 89 </tr><tr>
90 <td><a href="#DiffDialog.on_file1Button_clicked">on_file1Button_clicked</a></td> 90 <td><a href="#DiffDialog.on_file1Button_clicked">on_file1Button_clicked</a></td>
91 <td>&#80;&#114;&#105;v&#97;&#116;&#101; &#115;&#108;&#111;&#116; &#116;&#111; &#104;&#97;&#110;&#100;&#108;&#101; &#116;&#104;&#101; &#102;&#105;&#108;&#101; &#49; &#102;&#105;&#108;&#101; &#115;&#101;&#108;&#101;&#99;&#116;&#105;&#111;&#110; &#98;&#117;&#116;&#116;&#111;&#110; &#112;&#114;&#101;&#115;&#115;.</td> 91 <td>Private slot to handle the file 1 file selection button press.</td>
92 </tr><tr> 92 </tr><tr>
93 <td><a href="#DiffDialog.on_file2Button_clicked">on_file2Button_clicked</a></td> 93 <td><a href="#DiffDialog.on_file2Button_clicked">on_file2Button_clicked</a></td>
94 <td>&#80;&#114;&#105;v&#97;&#116;&#101; &#115;&#108;&#111;&#116; &#116;&#111; &#104;&#97;&#110;&#100;&#108;&#101; &#116;&#104;&#101; &#102;&#105;&#108;&#101; &#50; &#102;&#105;&#108;&#101; &#115;&#101;&#108;&#101;&#99;&#116;&#105;&#111;&#110; &#98;&#117;&#116;&#116;&#111;&#110; &#112;&#114;&#101;&#115;&#115;.</td> 94 <td>Private slot to handle the file 2 file selection button press.</td>
95 </tr><tr> 95 </tr><tr>
96 <td><a href="#DiffDialog.on_saveButton_clicked">on_saveButton_clicked</a></td> 96 <td><a href="#DiffDialog.on_saveButton_clicked">on_saveButton_clicked</a></td>
97 <td>&#80;&#114;&#105;v&#97;&#116;&#101; &#115;&#108;&#111;&#116; &#116;&#111; &#104;&#97;&#110;&#100;&#108;&#101; &#116;&#104;&#101; &#83;&#97;v&#101; &#98;&#117;&#116;&#116;&#111;&#110; &#112;&#114;&#101;&#115;&#115;.</td> 97 <td>Private slot to handle the Save button press.</td>
98 </tr><tr> 98 </tr><tr>
99 <td><a href="#DiffDialog.show">show</a></td> 99 <td><a href="#DiffDialog.show">show</a></td>
100 <td>&#80;&#117;&#98;&#108;&#105;&#99; &#115;&#108;&#111;&#116; &#116;&#111; &#115;&#104;&#111;w &#116;&#104;&#101; &#100;&#105;&#97;&#108;&#111;&#103;.</td> 100 <td>Public slot to show the dialog.</td>
101 </tr> 101 </tr>
102 </table> 102 </table>
103 <a NAME="DiffDialog.__init__" ID="DiffDialog.__init__"></a> 103 <a NAME="DiffDialog.__init__" ID="DiffDialog.__init__"></a>
104 <h4>DiffDialog (Constructor)</h4> 104 <h4>DiffDialog (Constructor)</h4>
105 <b>DiffDialog</b>(<i>parent = None</i>) 105 <b>DiffDialog</b>(<i>parent = None</i>)
106 <p> 106 <p>
107 &#67;&#111;&#110;&#115;&#116;&#114;&#117;&#99;&#116;&#111;&#114; 107 Constructor
108 </p><a NAME="DiffDialog.__appendText" ID="DiffDialog.__appendText"></a> 108 </p><a NAME="DiffDialog.__appendText" ID="DiffDialog.__appendText"></a>
109 <h4>DiffDialog.__appendText</h4> 109 <h4>DiffDialog.__appendText</h4>
110 <b>__appendText</b>(<i>txt, format</i>) 110 <b>__appendText</b>(<i>txt, format</i>)
111 <p> 111 <p>
112 &#80;&#114;&#105;v&#97;&#116;&#101; &#109;&#101;&#116;&#104;&#111;&#100; &#116;&#111; &#97;&#112;&#112;&#101;&#110;&#100; &#116;&#101;x&#116; &#116;&#111; &#116;&#104;&#101; &#101;&#110;&#100; &#111;&#102; &#116;&#104;&#101; &#99;&#111;&#110;&#116;&#101;&#110;&#116;&#115; &#112;&#97;&#110;&#101;. 112 Private method to append text to the end of the contents pane.
113 </p><dl> 113 </p><dl>
114 <dt><i>txt</i></dt> 114 <dt><i>txt</i></dt>
115 <dd> 115 <dd>
116 &#116;&#101;x&#116; &#116;&#111; &#105;&#110;&#115;&#101;&#114;&#116; (&#115;&#116;&#114;&#105;&#110;&#103;) 116 text to insert (string)
117 </dd><dt><i>format</i></dt> 117 </dd><dt><i>format</i></dt>
118 <dd> 118 <dd>
119 &#116;&#101;x&#116; &#102;&#111;&#114;&#109;&#97;&#116; &#116;&#111; &#98;&#101; &#117;&#115;&#101;&#100; (&#81;&#84;&#101;x&#116;&#67;&#104;&#97;&#114;&#70;&#111;&#114;&#109;&#97;&#116;) 119 text format to be used (QTextCharFormat)
120 </dd> 120 </dd>
121 </dl><a NAME="DiffDialog.__fileChanged" ID="DiffDialog.__fileChanged"></a> 121 </dl><a NAME="DiffDialog.__fileChanged" ID="DiffDialog.__fileChanged"></a>
122 <h4>DiffDialog.__fileChanged</h4> 122 <h4>DiffDialog.__fileChanged</h4>
123 <b>__fileChanged</b>(<i></i>) 123 <b>__fileChanged</b>(<i></i>)
124 <p> 124 <p>
125 &#80;&#114;&#105;v&#97;&#116;&#101; &#115;&#108;&#111;&#116; &#116;&#111; &#101;&#110;&#97;&#98;&#108;&#101;/&#100;&#105;&#115;&#97;&#98;&#108;&#101; &#116;&#104;&#101; &#67;&#111;&#109;&#112;&#97;&#114;&#101; &#98;&#117;&#116;&#116;&#111;&#110;. 125 Private slot to enable/disable the Compare button.
126 </p><a NAME="DiffDialog.__generateContextDiff" ID="DiffDialog.__generateContextDiff"></a> 126 </p><a NAME="DiffDialog.__generateContextDiff" ID="DiffDialog.__generateContextDiff"></a>
127 <h4>DiffDialog.__generateContextDiff</h4> 127 <h4>DiffDialog.__generateContextDiff</h4>
128 <b>__generateContextDiff</b>(<i>a, b, fromfile, tofile, fromfiledate, tofiledate</i>) 128 <b>__generateContextDiff</b>(<i>a, b, fromfile, tofile, fromfiledate, tofiledate</i>)
129 <p> 129 <p>
130 &#80;&#114;&#105;v&#97;&#116;&#101; &#115;&#108;&#111;&#116; &#116;&#111; &#103;&#101;&#110;&#101;&#114;&#97;&#116;&#101; &#97; &#99;&#111;&#110;&#116;&#101;x&#116; &#100;&#105;&#102;&#102; &#111;&#117;&#116;&#112;&#117;&#116;. 130 Private slot to generate a context diff output.
131 </p><dl> 131 </p><dl>
132 <dt><i>a</i></dt> 132 <dt><i>a</i></dt>
133 <dd> 133 <dd>
134 &#102;&#105;&#114;&#115;&#116; &#115;&#101;&#113;&#117;&#101;&#110;&#99;&#101; &#111;&#102; &#108;&#105;&#110;&#101;&#115; (&#108;&#105;&#115;&#116; &#111;&#102; &#115;&#116;&#114;&#105;&#110;&#103;&#115;) 134 first sequence of lines (list of strings)
135 </dd><dt><i>b</i></dt> 135 </dd><dt><i>b</i></dt>
136 <dd> 136 <dd>
137 &#115;&#101;&#99;&#111;&#110;&#100; &#115;&#101;&#113;&#117;&#101;&#110;&#99;&#101; &#111;&#102; &#108;&#105;&#110;&#101;&#115; (&#108;&#105;&#115;&#116; &#111;&#102; &#115;&#116;&#114;&#105;&#110;&#103;&#115;) 137 second sequence of lines (list of strings)
138 </dd><dt><i>fromfile</i></dt> 138 </dd><dt><i>fromfile</i></dt>
139 <dd> 139 <dd>
140 &#102;&#105;&#108;&#101;&#110;&#97;&#109;&#101; &#111;&#102; &#116;&#104;&#101; &#102;&#105;&#114;&#115;&#116; &#102;&#105;&#108;&#101; (&#115;&#116;&#114;&#105;&#110;&#103;) 140 filename of the first file (string)
141 </dd><dt><i>tofile</i></dt> 141 </dd><dt><i>tofile</i></dt>
142 <dd> 142 <dd>
143 &#102;&#105;&#108;&#101;&#110;&#97;&#109;&#101; &#111;&#102; &#116;&#104;&#101; &#115;&#101;&#99;&#111;&#110;&#100; &#102;&#105;&#108;&#101; (&#115;&#116;&#114;&#105;&#110;&#103;) 143 filename of the second file (string)
144 </dd><dt><i>fromfiledate</i></dt> 144 </dd><dt><i>fromfiledate</i></dt>
145 <dd> 145 <dd>
146 &#109;&#111;&#100;&#105;&#102;&#105;&#99;&#97;&#116;&#105;&#111;&#110; &#116;&#105;&#109;&#101; &#111;&#102; &#116;&#104;&#101; &#102;&#105;&#114;&#115;&#116; &#102;&#105;&#108;&#101; (&#115;&#116;&#114;&#105;&#110;&#103;) 146 modification time of the first file (string)
147 </dd><dt><i>tofiledate</i></dt> 147 </dd><dt><i>tofiledate</i></dt>
148 <dd> 148 <dd>
149 &#109;&#111;&#100;&#105;&#102;&#105;&#99;&#97;&#116;&#105;&#111;&#110; &#116;&#105;&#109;&#101; &#111;&#102; &#116;&#104;&#101; &#115;&#101;&#99;&#111;&#110;&#100; &#102;&#105;&#108;&#101; (&#115;&#116;&#114;&#105;&#110;&#103;) 149 modification time of the second file (string)
150 </dd> 150 </dd>
151 </dl><a NAME="DiffDialog.__generateUnifiedDiff" ID="DiffDialog.__generateUnifiedDiff"></a> 151 </dl><a NAME="DiffDialog.__generateUnifiedDiff" ID="DiffDialog.__generateUnifiedDiff"></a>
152 <h4>DiffDialog.__generateUnifiedDiff</h4> 152 <h4>DiffDialog.__generateUnifiedDiff</h4>
153 <b>__generateUnifiedDiff</b>(<i>a, b, fromfile, tofile, fromfiledate, tofiledate</i>) 153 <b>__generateUnifiedDiff</b>(<i>a, b, fromfile, tofile, fromfiledate, tofiledate</i>)
154 <p> 154 <p>
155 &#80;&#114;&#105;v&#97;&#116;&#101; &#115;&#108;&#111;&#116; &#116;&#111; &#103;&#101;&#110;&#101;&#114;&#97;&#116;&#101; &#97; &#117;&#110;&#105;&#102;&#105;&#101;&#100; &#100;&#105;&#102;&#102; &#111;&#117;&#116;&#112;&#117;&#116;. 155 Private slot to generate a unified diff output.
156 </p><dl> 156 </p><dl>
157 <dt><i>a</i></dt> 157 <dt><i>a</i></dt>
158 <dd> 158 <dd>
159 &#102;&#105;&#114;&#115;&#116; &#115;&#101;&#113;&#117;&#101;&#110;&#99;&#101; &#111;&#102; &#108;&#105;&#110;&#101;&#115; (&#108;&#105;&#115;&#116; &#111;&#102; &#115;&#116;&#114;&#105;&#110;&#103;&#115;) 159 first sequence of lines (list of strings)
160 </dd><dt><i>b</i></dt> 160 </dd><dt><i>b</i></dt>
161 <dd> 161 <dd>
162 &#115;&#101;&#99;&#111;&#110;&#100; &#115;&#101;&#113;&#117;&#101;&#110;&#99;&#101; &#111;&#102; &#108;&#105;&#110;&#101;&#115; (&#108;&#105;&#115;&#116; &#111;&#102; &#115;&#116;&#114;&#105;&#110;&#103;&#115;) 162 second sequence of lines (list of strings)
163 </dd><dt><i>fromfile</i></dt> 163 </dd><dt><i>fromfile</i></dt>
164 <dd> 164 <dd>
165 &#102;&#105;&#108;&#101;&#110;&#97;&#109;&#101; &#111;&#102; &#116;&#104;&#101; &#102;&#105;&#114;&#115;&#116; &#102;&#105;&#108;&#101; (&#115;&#116;&#114;&#105;&#110;&#103;) 165 filename of the first file (string)
166 </dd><dt><i>tofile</i></dt> 166 </dd><dt><i>tofile</i></dt>
167 <dd> 167 <dd>
168 &#102;&#105;&#108;&#101;&#110;&#97;&#109;&#101; &#111;&#102; &#116;&#104;&#101; &#115;&#101;&#99;&#111;&#110;&#100; &#102;&#105;&#108;&#101; (&#115;&#116;&#114;&#105;&#110;&#103;) 168 filename of the second file (string)
169 </dd><dt><i>fromfiledate</i></dt> 169 </dd><dt><i>fromfiledate</i></dt>
170 <dd> 170 <dd>
171 &#109;&#111;&#100;&#105;&#102;&#105;&#99;&#97;&#116;&#105;&#111;&#110; &#116;&#105;&#109;&#101; &#111;&#102; &#116;&#104;&#101; &#102;&#105;&#114;&#115;&#116; &#102;&#105;&#108;&#101; (&#115;&#116;&#114;&#105;&#110;&#103;) 171 modification time of the first file (string)
172 </dd><dt><i>tofiledate</i></dt> 172 </dd><dt><i>tofiledate</i></dt>
173 <dd> 173 <dd>
174 &#109;&#111;&#100;&#105;&#102;&#105;&#99;&#97;&#116;&#105;&#111;&#110; &#116;&#105;&#109;&#101; &#111;&#102; &#116;&#104;&#101; &#115;&#101;&#99;&#111;&#110;&#100; &#102;&#105;&#108;&#101; (&#115;&#116;&#114;&#105;&#110;&#103;) 174 modification time of the second file (string)
175 </dd> 175 </dd>
176 </dl><a NAME="DiffDialog.__selectFile" ID="DiffDialog.__selectFile"></a> 176 </dl><a NAME="DiffDialog.__selectFile" ID="DiffDialog.__selectFile"></a>
177 <h4>DiffDialog.__selectFile</h4> 177 <h4>DiffDialog.__selectFile</h4>
178 <b>__selectFile</b>(<i>lineEdit</i>) 178 <b>__selectFile</b>(<i>lineEdit</i>)
179 <p> 179 <p>
180 &#80;&#114;&#105;v&#97;&#116;&#101; &#115;&#108;&#111;&#116; &#116;&#111; &#100;&#105;&#115;&#112;&#108;&#97;y &#97; &#102;&#105;&#108;&#101; &#115;&#101;&#108;&#101;&#99;&#116;&#105;&#111;&#110; &#100;&#105;&#97;&#108;&#111;&#103;. 180 Private slot to display a file selection dialog.
181 </p><dl> 181 </p><dl>
182 <dt><i>lineEdit</i></dt> 182 <dt><i>lineEdit</i></dt>
183 <dd> 183 <dd>
184 &#102;&#105;&#101;&#108;&#100; &#102;&#111;&#114; &#116;&#104;&#101; &#100;&#105;&#115;&#112;&#108;&#97;y &#111;&#102; &#116;&#104;&#101; &#115;&#101;&#108;&#101;&#99;&#116;&#101;&#100; &#102;&#105;&#108;&#101;&#110;&#97;&#109;&#101; 184 field for the display of the selected filename
185 (&#81;&#76;&#105;&#110;&#101;&#69;&#100;&#105;&#116;) 185 (QLineEdit)
186 </dd> 186 </dd>
187 </dl><a NAME="DiffDialog.on_buttonBox_clicked" ID="DiffDialog.on_buttonBox_clicked"></a> 187 </dl><a NAME="DiffDialog.on_buttonBox_clicked" ID="DiffDialog.on_buttonBox_clicked"></a>
188 <h4>DiffDialog.on_buttonBox_clicked</h4> 188 <h4>DiffDialog.on_buttonBox_clicked</h4>
189 <b>on_buttonBox_clicked</b>(<i>button</i>) 189 <b>on_buttonBox_clicked</b>(<i>button</i>)
190 <p> 190 <p>
191 &#80;&#114;&#105;v&#97;&#116;&#101; &#115;&#108;&#111;&#116; &#99;&#97;&#108;&#108;&#101;&#100; &#98;y &#97; &#98;&#117;&#116;&#116;&#111;&#110; &#111;&#102; &#116;&#104;&#101; &#98;&#117;&#116;&#116;&#111;&#110; &#98;&#111;x &#99;&#108;&#105;&#99;&#107;&#101;&#100;. 191 Private slot called by a button of the button box clicked.
192 </p><dl> 192 </p><dl>
193 <dt><i>button</i></dt> 193 <dt><i>button</i></dt>
194 <dd> 194 <dd>
195 &#98;&#117;&#116;&#116;&#111;&#110; &#116;&#104;&#97;&#116; w&#97;&#115; &#99;&#108;&#105;&#99;&#107;&#101;&#100; (&#81;&#65;&#98;&#115;&#116;&#114;&#97;&#99;&#116;&#66;&#117;&#116;&#116;&#111;&#110;) 195 button that was clicked (QAbstractButton)
196 </dd> 196 </dd>
197 </dl><a NAME="DiffDialog.on_diffButton_clicked" ID="DiffDialog.on_diffButton_clicked"></a> 197 </dl><a NAME="DiffDialog.on_diffButton_clicked" ID="DiffDialog.on_diffButton_clicked"></a>
198 <h4>DiffDialog.on_diffButton_clicked</h4> 198 <h4>DiffDialog.on_diffButton_clicked</h4>
199 <b>on_diffButton_clicked</b>(<i></i>) 199 <b>on_diffButton_clicked</b>(<i></i>)
200 <p> 200 <p>
201 &#80;&#114;&#105;v&#97;&#116;&#101; &#115;&#108;&#111;&#116; &#116;&#111; &#104;&#97;&#110;&#100;&#108;&#101; &#116;&#104;&#101; &#67;&#111;&#109;&#112;&#97;&#114;&#101; &#98;&#117;&#116;&#116;&#111;&#110; &#112;&#114;&#101;&#115;&#115;. 201 Private slot to handle the Compare button press.
202 </p><a NAME="DiffDialog.on_file1Button_clicked" ID="DiffDialog.on_file1Button_clicked"></a> 202 </p><a NAME="DiffDialog.on_file1Button_clicked" ID="DiffDialog.on_file1Button_clicked"></a>
203 <h4>DiffDialog.on_file1Button_clicked</h4> 203 <h4>DiffDialog.on_file1Button_clicked</h4>
204 <b>on_file1Button_clicked</b>(<i></i>) 204 <b>on_file1Button_clicked</b>(<i></i>)
205 <p> 205 <p>
206 &#80;&#114;&#105;v&#97;&#116;&#101; &#115;&#108;&#111;&#116; &#116;&#111; &#104;&#97;&#110;&#100;&#108;&#101; &#116;&#104;&#101; &#102;&#105;&#108;&#101; &#49; &#102;&#105;&#108;&#101; &#115;&#101;&#108;&#101;&#99;&#116;&#105;&#111;&#110; &#98;&#117;&#116;&#116;&#111;&#110; &#112;&#114;&#101;&#115;&#115;. 206 Private slot to handle the file 1 file selection button press.
207 </p><a NAME="DiffDialog.on_file2Button_clicked" ID="DiffDialog.on_file2Button_clicked"></a> 207 </p><a NAME="DiffDialog.on_file2Button_clicked" ID="DiffDialog.on_file2Button_clicked"></a>
208 <h4>DiffDialog.on_file2Button_clicked</h4> 208 <h4>DiffDialog.on_file2Button_clicked</h4>
209 <b>on_file2Button_clicked</b>(<i></i>) 209 <b>on_file2Button_clicked</b>(<i></i>)
210 <p> 210 <p>
211 &#80;&#114;&#105;v&#97;&#116;&#101; &#115;&#108;&#111;&#116; &#116;&#111; &#104;&#97;&#110;&#100;&#108;&#101; &#116;&#104;&#101; &#102;&#105;&#108;&#101; &#50; &#102;&#105;&#108;&#101; &#115;&#101;&#108;&#101;&#99;&#116;&#105;&#111;&#110; &#98;&#117;&#116;&#116;&#111;&#110; &#112;&#114;&#101;&#115;&#115;. 211 Private slot to handle the file 2 file selection button press.
212 </p><a NAME="DiffDialog.on_saveButton_clicked" ID="DiffDialog.on_saveButton_clicked"></a> 212 </p><a NAME="DiffDialog.on_saveButton_clicked" ID="DiffDialog.on_saveButton_clicked"></a>
213 <h4>DiffDialog.on_saveButton_clicked</h4> 213 <h4>DiffDialog.on_saveButton_clicked</h4>
214 <b>on_saveButton_clicked</b>(<i></i>) 214 <b>on_saveButton_clicked</b>(<i></i>)
215 <p> 215 <p>
216 &#80;&#114;&#105;v&#97;&#116;&#101; &#115;&#108;&#111;&#116; &#116;&#111; &#104;&#97;&#110;&#100;&#108;&#101; &#116;&#104;&#101; &#83;&#97;v&#101; &#98;&#117;&#116;&#116;&#111;&#110; &#112;&#114;&#101;&#115;&#115;. 216 Private slot to handle the Save button press.
217 </p><p> 217 </p><p>
218 &#73;&#116; &#115;&#97;v&#101;&#115; &#116;&#104;&#101; &#100;&#105;&#102;&#102; &#115;&#104;&#111;w&#110; &#105;&#110; &#116;&#104;&#101; &#100;&#105;&#97;&#108;&#111;&#103; &#116;&#111; &#97; &#102;&#105;&#108;&#101; &#105;&#110; &#116;&#104;&#101; &#108;&#111;&#99;&#97;&#108; 218 It saves the diff shown in the dialog to a file in the local
219 &#102;&#105;&#108;&#101;&#115;y&#115;&#116;&#101;&#109;. 219 filesystem.
220 </p><a NAME="DiffDialog.show" ID="DiffDialog.show"></a> 220 </p><a NAME="DiffDialog.show" ID="DiffDialog.show"></a>
221 <h4>DiffDialog.show</h4> 221 <h4>DiffDialog.show</h4>
222 <b>show</b>(<i>filename = None</i>) 222 <b>show</b>(<i>filename = None</i>)
223 <p> 223 <p>
224 &#80;&#117;&#98;&#108;&#105;&#99; &#115;&#108;&#111;&#116; &#116;&#111; &#115;&#104;&#111;w &#116;&#104;&#101; &#100;&#105;&#97;&#108;&#111;&#103;. 224 Public slot to show the dialog.
225 </p><dl> 225 </p><dl>
226 <dt><i>filename</i></dt> 226 <dt><i>filename</i></dt>
227 <dd> 227 <dd>
228 &#110;&#97;&#109;&#101; &#111;&#102; &#97; &#102;&#105;&#108;&#101; &#116;&#111; &#117;&#115;&#101; &#97;&#115; &#116;&#104;&#101; &#102;&#105;&#114;&#115;&#116; &#102;&#105;&#108;&#101; (&#115;&#116;&#114;&#105;&#110;&#103;) 228 name of a file to use as the first file (string)
229 </dd> 229 </dd>
230 </dl> 230 </dl>
231 <div align="right"><a href="#top">Up</a></div> 231 <div align="right"><a href="#top">Up</a></div>
232 <hr /><hr /> 232 <hr /><hr />
233 <a NAME="DiffWindow" ID="DiffWindow"></a> 233 <a NAME="DiffWindow" ID="DiffWindow"></a>
234 <h2>DiffWindow</h2> 234 <h2>DiffWindow</h2>
235 <p> 235 <p>
236 &#77;&#97;&#105;&#110; w&#105;&#110;&#100;&#111;w &#99;&#108;&#97;&#115;&#115; &#102;&#111;&#114; &#116;&#104;&#101; &#115;&#116;&#97;&#110;&#100;&#97;&#108;&#111;&#110;&#101; &#100;&#105;&#97;&#108;&#111;&#103;. 236 Main window class for the standalone dialog.
237 </p> 237 </p>
238 <h3>Derived from</h3> 238 <h3>Derived from</h3>
239 QMainWindow 239 QMainWindow
240 <h3>Class Attributes</h3> 240 <h3>Class Attributes</h3>
241 <table> 241 <table>
243 </table> 243 </table>
244 <h3>Methods</h3> 244 <h3>Methods</h3>
245 <table> 245 <table>
246 <tr> 246 <tr>
247 <td><a href="#DiffWindow.__init__">DiffWindow</a></td> 247 <td><a href="#DiffWindow.__init__">DiffWindow</a></td>
248 <td>&#67;&#111;&#110;&#115;&#116;&#114;&#117;&#99;&#116;&#111;&#114;</td> 248 <td>Constructor</td>
249 </tr><tr> 249 </tr><tr>
250 <td><a href="#DiffWindow.eventFilter">eventFilter</a></td> 250 <td><a href="#DiffWindow.eventFilter">eventFilter</a></td>
251 <td>&#80;&#117;&#98;&#108;&#105;&#99; &#109;&#101;&#116;&#104;&#111;&#100; &#116;&#111; &#102;&#105;&#108;&#116;&#101;&#114; &#101;v&#101;&#110;&#116;&#115;.</td> 251 <td>Public method to filter events.</td>
252 </tr> 252 </tr>
253 </table> 253 </table>
254 <a NAME="DiffWindow.__init__" ID="DiffWindow.__init__"></a> 254 <a NAME="DiffWindow.__init__" ID="DiffWindow.__init__"></a>
255 <h4>DiffWindow (Constructor)</h4> 255 <h4>DiffWindow (Constructor)</h4>
256 <b>DiffWindow</b>(<i>parent = None</i>) 256 <b>DiffWindow</b>(<i>parent = None</i>)
257 <p> 257 <p>
258 &#67;&#111;&#110;&#115;&#116;&#114;&#117;&#99;&#116;&#111;&#114; 258 Constructor
259 </p><dl> 259 </p><dl>
260 <dt><i>parent</i></dt> 260 <dt><i>parent</i></dt>
261 <dd> 261 <dd>
262 &#114;&#101;&#102;&#101;&#114;&#101;&#110;&#99;&#101; &#116;&#111; &#116;&#104;&#101; &#112;&#97;&#114;&#101;&#110;&#116; w&#105;&#100;&#103;&#101;&#116; (&#81;&#87;&#105;&#100;&#103;&#101;&#116;) 262 reference to the parent widget (QWidget)
263 </dd> 263 </dd>
264 </dl><a NAME="DiffWindow.eventFilter" ID="DiffWindow.eventFilter"></a> 264 </dl><a NAME="DiffWindow.eventFilter" ID="DiffWindow.eventFilter"></a>
265 <h4>DiffWindow.eventFilter</h4> 265 <h4>DiffWindow.eventFilter</h4>
266 <b>eventFilter</b>(<i>obj, event</i>) 266 <b>eventFilter</b>(<i>obj, event</i>)
267 <p> 267 <p>
268 &#80;&#117;&#98;&#108;&#105;&#99; &#109;&#101;&#116;&#104;&#111;&#100; &#116;&#111; &#102;&#105;&#108;&#116;&#101;&#114; &#101;v&#101;&#110;&#116;&#115;. 268 Public method to filter events.
269 </p><dl> 269 </p><dl>
270 <dt><i>obj</i></dt> 270 <dt><i>obj</i></dt>
271 <dd> 271 <dd>
272 &#114;&#101;&#102;&#101;&#114;&#101;&#110;&#99;&#101; &#116;&#111; &#116;&#104;&#101; &#111;&#98;&#106;&#101;&#99;&#116; &#116;&#104;&#101; &#101;v&#101;&#110;&#116; &#105;&#115; &#109;&#101;&#97;&#110;&#116; &#102;&#111;&#114; (&#81;&#79;&#98;&#106;&#101;&#99;&#116;) 272 reference to the object the event is meant for (QObject)
273 </dd><dt><i>event</i></dt> 273 </dd><dt><i>event</i></dt>
274 <dd> 274 <dd>
275 &#114;&#101;&#102;&#101;&#114;&#101;&#110;&#99;&#101; &#116;&#111; &#116;&#104;&#101; &#101;v&#101;&#110;&#116; &#111;&#98;&#106;&#101;&#99;&#116; (&#81;&#69;v&#101;&#110;&#116;) 275 reference to the event object (QEvent)
276 </dd> 276 </dd>
277 </dl><dl> 277 </dl><dl>
278 <dt>Returns:</dt> 278 <dt>Returns:</dt>
279 <dd> 279 <dd>
280 &#102;&#108;&#97;&#103; &#105;&#110;&#100;&#105;&#99;&#97;&#116;&#105;&#110;&#103;, w&#104;&#101;&#116;&#104;&#101;&#114; &#116;&#104;&#101; &#101;v&#101;&#110;&#116; w&#97;&#115; &#104;&#97;&#110;&#100;&#108;&#101;&#100; (&#98;&#111;&#111;&#108;&#101;&#97;&#110;) 280 flag indicating, whether the event was handled (boolean)
281 </dd> 281 </dd>
282 </dl> 282 </dl>
283 <div align="right"><a href="#top">Up</a></div> 283 <div align="right"><a href="#top">Up</a></div>
284 <hr /><hr /> 284 <hr /><hr />
285 <a NAME="context_diff" ID="context_diff"></a> 285 <a NAME="context_diff" ID="context_diff"></a>
286 <h2>context_diff</h2> 286 <h2>context_diff</h2>
287 <b>context_diff</b>(<i>a, b, fromfile='', tofile='', fromfiledate='', tofiledate='', n=3, lineterm='\n'</i>) 287 <b>context_diff</b>(<i>a, b, fromfile='', tofile='', fromfiledate='', tofiledate='', n=3, lineterm='\n'</i>)
288 <p> 288 <p>
289 &#67;&#111;&#109;&#112;&#97;&#114;&#101; &#116;w&#111; &#115;&#101;&#113;&#117;&#101;&#110;&#99;&#101;&#115; &#111;&#102; &#108;&#105;&#110;&#101;&#115;&#59; &#103;&#101;&#110;&#101;&#114;&#97;&#116;&#101; &#116;&#104;&#101; &#100;&#101;&#108;&#116;&#97; &#97;&#115; &#97; &#99;&#111;&#110;&#116;&#101;x&#116; &#100;&#105;&#102;&#102;. 289 Compare two sequences of lines; generate the delta as a context diff.
290 </p><p> 290 </p><p>
291 &#67;&#111;&#110;&#116;&#101;x&#116; &#100;&#105;&#102;&#102;&#115; &#97;&#114;&#101; &#97; &#99;&#111;&#109;&#112;&#97;&#99;&#116; w&#97;y &#111;&#102; &#115;&#104;&#111;w&#105;&#110;&#103; &#108;&#105;&#110;&#101; &#99;&#104;&#97;&#110;&#103;&#101;&#115; &#97;&#110;&#100; &#97; &#102;&#101;w 291 Context diffs are a compact way of showing line changes and a few
292 &#108;&#105;&#110;&#101;&#115; &#111;&#102; &#99;&#111;&#110;&#116;&#101;x&#116;. &#84;&#104;&#101; &#110;&#117;&#109;&#98;&#101;&#114; &#111;&#102; &#99;&#111;&#110;&#116;&#101;x&#116; &#108;&#105;&#110;&#101;&#115; &#105;&#115; &#115;&#101;&#116; &#98;y '&#110;' w&#104;&#105;&#99;&#104; 292 lines of context. The number of context lines is set by 'n' which
293 &#100;&#101;&#102;&#97;&#117;&#108;&#116;&#115; &#116;&#111; &#116;&#104;&#114;&#101;&#101;. 293 defaults to three.
294 </p><p> 294 </p><p>
295 &#66;y &#100;&#101;&#102;&#97;&#117;&#108;&#116;, &#116;&#104;&#101; &#100;&#105;&#102;&#102; &#99;&#111;&#110;&#116;&#114;&#111;&#108; &#108;&#105;&#110;&#101;&#115; (&#116;&#104;&#111;&#115;&#101; w&#105;&#116;&#104; *** &#111;&#114; ---) &#97;&#114;&#101; 295 By default, the diff control lines (those with *** or ---) are
296 &#99;&#114;&#101;&#97;&#116;&#101;&#100; w&#105;&#116;&#104; &#97; &#116;&#114;&#97;&#105;&#108;&#105;&#110;&#103; &#110;&#101;w&#108;&#105;&#110;&#101;. &#84;&#104;&#105;&#115; &#105;&#115; &#104;&#101;&#108;&#112;&#102;&#117;&#108; &#115;&#111; &#116;&#104;&#97;&#116; &#105;&#110;&#112;&#117;&#116;&#115; 296 created with a trailing newline. This is helpful so that inputs
297 &#99;&#114;&#101;&#97;&#116;&#101;&#100; &#102;&#114;&#111;&#109; &#102;&#105;&#108;&#101;.&#114;&#101;&#97;&#100;&#108;&#105;&#110;&#101;&#115;() &#114;&#101;&#115;&#117;&#108;&#116; &#105;&#110; &#100;&#105;&#102;&#102;&#115; &#116;&#104;&#97;&#116; &#97;&#114;&#101; &#115;&#117;&#105;&#116;&#97;&#98;&#108;&#101; &#102;&#111;&#114; 297 created from file.readlines() result in diffs that are suitable for
298 &#102;&#105;&#108;&#101;.w&#114;&#105;&#116;&#101;&#108;&#105;&#110;&#101;&#115;() &#115;&#105;&#110;&#99;&#101; &#98;&#111;&#116;&#104; &#116;&#104;&#101; &#105;&#110;&#112;&#117;&#116;&#115; &#97;&#110;&#100; &#111;&#117;&#116;&#112;&#117;&#116;&#115; &#104;&#97;v&#101; &#116;&#114;&#97;&#105;&#108;&#105;&#110;&#103; 298 file.writelines() since both the inputs and outputs have trailing
299 &#110;&#101;w&#108;&#105;&#110;&#101;&#115;. 299 newlines.
300 </p><p> 300 </p><p>
301 &#70;&#111;&#114; &#105;&#110;&#112;&#117;&#116;&#115; &#116;&#104;&#97;&#116; &#100;&#111; &#110;&#111;&#116; &#104;&#97;v&#101; &#116;&#114;&#97;&#105;&#108;&#105;&#110;&#103; &#110;&#101;w&#108;&#105;&#110;&#101;&#115;, &#115;&#101;&#116; &#116;&#104;&#101; &#108;&#105;&#110;&#101;&#116;&#101;&#114;&#109; 301 For inputs that do not have trailing newlines, set the lineterm
302 &#97;&#114;&#103;&#117;&#109;&#101;&#110;&#116; &#116;&#111; "" &#115;&#111; &#116;&#104;&#97;&#116; &#116;&#104;&#101; &#111;&#117;&#116;&#112;&#117;&#116; w&#105;&#108;&#108; &#98;&#101; &#117;&#110;&#105;&#102;&#111;&#114;&#109;&#108;y &#110;&#101;w&#108;&#105;&#110;&#101; &#102;&#114;&#101;&#101;. 302 argument to "" so that the output will be uniformly newline free.
303 </p><p> 303 </p><p>
304 &#84;&#104;&#101; &#99;&#111;&#110;&#116;&#101;x&#116; &#100;&#105;&#102;&#102; &#102;&#111;&#114;&#109;&#97;&#116; &#110;&#111;&#114;&#109;&#97;&#108;&#108;y &#104;&#97;&#115; &#97; &#104;&#101;&#97;&#100;&#101;&#114; &#102;&#111;&#114; &#102;&#105;&#108;&#101;&#110;&#97;&#109;&#101;&#115; &#97;&#110;&#100; 304 The context diff format normally has a header for filenames and
305 &#109;&#111;&#100;&#105;&#102;&#105;&#99;&#97;&#116;&#105;&#111;&#110; &#116;&#105;&#109;&#101;&#115;. &#65;&#110;y &#111;&#114; &#97;&#108;&#108; &#111;&#102; &#116;&#104;&#101;&#115;&#101; &#109;&#97;y &#98;&#101; &#115;&#112;&#101;&#99;&#105;&#102;&#105;&#101;&#100; &#117;&#115;&#105;&#110;&#103; 305 modification times. Any or all of these may be specified using
306 &#115;&#116;&#114;&#105;&#110;&#103;&#115; &#102;&#111;&#114; '&#102;&#114;&#111;&#109;&#102;&#105;&#108;&#101;', '&#116;&#111;&#102;&#105;&#108;&#101;', '&#102;&#114;&#111;&#109;&#102;&#105;&#108;&#101;&#100;&#97;&#116;&#101;', &#97;&#110;&#100; '&#116;&#111;&#102;&#105;&#108;&#101;&#100;&#97;&#116;&#101;'. 306 strings for 'fromfile', 'tofile', 'fromfiledate', and 'tofiledate'.
307 &#84;&#104;&#101; &#109;&#111;&#100;&#105;&#102;&#105;&#99;&#97;&#116;&#105;&#111;&#110; &#116;&#105;&#109;&#101;&#115; &#97;&#114;&#101; &#110;&#111;&#114;&#109;&#97;&#108;&#108;y &#101;x&#112;&#114;&#101;&#115;&#115;&#101;&#100; &#105;&#110; &#116;&#104;&#101; &#102;&#111;&#114;&#109;&#97;&#116; &#114;&#101;&#116;&#117;&#114;&#110;&#101;&#100; 307 The modification times are normally expressed in the format returned
308 &#98;y &#116;&#105;&#109;&#101;.&#99;&#116;&#105;&#109;&#101;(). &#73;&#102; &#110;&#111;&#116; &#115;&#112;&#101;&#99;&#105;&#102;&#105;&#101;&#100;, &#116;&#104;&#101; &#115;&#116;&#114;&#105;&#110;&#103;&#115; &#100;&#101;&#102;&#97;&#117;&#108;&#116; &#116;&#111; &#98;&#108;&#97;&#110;&#107;&#115;. 308 by time.ctime(). If not specified, the strings default to blanks.
309 </p><p> 309 </p><p>
310 &#69;x&#97;&#109;&#112;&#108;&#101;&#58; 310 Example:
311 </p><p> 311 </p><p>
312 &#60;&#112;&#114;&#101;&#62; 312 <pre>
313 &&#103;&#116;&#59;&&#103;&#116;&#59;&&#103;&#116;&#59; &#112;&#114;&#105;&#110;&#116; ''.&#106;&#111;&#105;&#110;(&#99;&#111;&#110;&#116;&#101;x&#116;&#95;&#100;&#105;&#102;&#102;('&#111;&#110;&#101;&#92;&#110;&#116;w&#111;&#92;&#110;&#116;&#104;&#114;&#101;&#101;&#92;&#110;&#102;&#111;&#117;&#114;&#92;&#110;'.&#115;&#112;&#108;&#105;&#116;&#108;&#105;&#110;&#101;&#115;(&#49;), 313 &gt;&gt;&gt; print ''.join(context_diff('one\ntwo\nthree\nfour\n'.splitlines(1),
314 ... 'z&#101;&#114;&#111;&#92;&#110;&#111;&#110;&#101;&#92;&#110;&#116;&#114;&#101;&#101;&#92;&#110;&#102;&#111;&#117;&#114;&#92;&#110;'.&#115;&#112;&#108;&#105;&#116;&#108;&#105;&#110;&#101;&#115;(&#49;), '&#79;&#114;&#105;&#103;&#105;&#110;&#97;&#108;', '&#67;&#117;&#114;&#114;&#101;&#110;&#116;', 314 ... 'zero\none\ntree\nfour\n'.splitlines(1), 'Original', 'Current',
315 ... '&#83;&#97;&#116; &#74;&#97;&#110; &#50;&#54; &#50;&#51;&#58;&#51;&#48;&#58;&#53;&#48; &#49;&#57;&#57;&#49;', '&#70;&#114;&#105; &#74;&#117;&#110; &#48;&#54; &#49;&#48;&#58;&#50;&#50;&#58;&#52;&#54; &#50;&#48;&#48;&#51;')), 315 ... 'Sat Jan 26 23:30:50 1991', 'Fri Jun 06 10:22:46 2003')),
316 *** &#79;&#114;&#105;&#103;&#105;&#110;&#97;&#108; &#83;&#97;&#116; &#74;&#97;&#110; &#50;&#54; &#50;&#51;&#58;&#51;&#48;&#58;&#53;&#48; &#49;&#57;&#57;&#49; 316 *** Original Sat Jan 26 23:30:50 1991
317 --- &#67;&#117;&#114;&#114;&#101;&#110;&#116; &#70;&#114;&#105; &#74;&#117;&#110; &#48;&#54; &#49;&#48;&#58;&#50;&#50;&#58;&#52;&#54; &#50;&#48;&#48;&#51; 317 --- Current Fri Jun 06 10:22:46 2003
318 *************** 318 ***************
319 *** &#49;,&#52; **** 319 *** 1,4 ****
320 &#111;&#110;&#101; 320 one
321 ! &#116;w&#111; 321 ! two
322 ! &#116;&#104;&#114;&#101;&#101; 322 ! three
323 &#102;&#111;&#117;&#114; 323 four
324 --- &#49;,&#52; ---- 324 --- 1,4 ----
325 + z&#101;&#114;&#111; 325 + zero
326 &#111;&#110;&#101; 326 one
327 ! &#116;&#114;&#101;&#101; 327 ! tree
328 &#102;&#111;&#117;&#114; 328 four
329 &#60;/&#112;&#114;&#101;&#62; 329 </pre>
330 </p><dl> 330 </p><dl>
331 <dt><i>a</i></dt> 331 <dt><i>a</i></dt>
332 <dd> 332 <dd>
333 &#102;&#105;&#114;&#115;&#116; &#115;&#101;&#113;&#117;&#101;&#110;&#99;&#101; &#111;&#102; &#108;&#105;&#110;&#101;&#115; (&#108;&#105;&#115;&#116; &#111;&#102; &#115;&#116;&#114;&#105;&#110;&#103;&#115;) 333 first sequence of lines (list of strings)
334 </dd><dt><i>b</i></dt> 334 </dd><dt><i>b</i></dt>
335 <dd> 335 <dd>
336 &#115;&#101;&#99;&#111;&#110;&#100; &#115;&#101;&#113;&#117;&#101;&#110;&#99;&#101; &#111;&#102; &#108;&#105;&#110;&#101;&#115; (&#108;&#105;&#115;&#116; &#111;&#102; &#115;&#116;&#114;&#105;&#110;&#103;&#115;) 336 second sequence of lines (list of strings)
337 </dd><dt><i>fromfile</i></dt> 337 </dd><dt><i>fromfile</i></dt>
338 <dd> 338 <dd>
339 &#102;&#105;&#108;&#101;&#110;&#97;&#109;&#101; &#111;&#102; &#116;&#104;&#101; &#102;&#105;&#114;&#115;&#116; &#102;&#105;&#108;&#101; (&#115;&#116;&#114;&#105;&#110;&#103;) 339 filename of the first file (string)
340 </dd><dt><i>tofile</i></dt> 340 </dd><dt><i>tofile</i></dt>
341 <dd> 341 <dd>
342 &#102;&#105;&#108;&#101;&#110;&#97;&#109;&#101; &#111;&#102; &#116;&#104;&#101; &#115;&#101;&#99;&#111;&#110;&#100; &#102;&#105;&#108;&#101; (&#115;&#116;&#114;&#105;&#110;&#103;) 342 filename of the second file (string)
343 </dd><dt><i>fromfiledate</i></dt> 343 </dd><dt><i>fromfiledate</i></dt>
344 <dd> 344 <dd>
345 &#109;&#111;&#100;&#105;&#102;&#105;&#99;&#97;&#116;&#105;&#111;&#110; &#116;&#105;&#109;&#101; &#111;&#102; &#116;&#104;&#101; &#102;&#105;&#114;&#115;&#116; &#102;&#105;&#108;&#101; (&#115;&#116;&#114;&#105;&#110;&#103;) 345 modification time of the first file (string)
346 </dd><dt><i>tofiledate</i></dt> 346 </dd><dt><i>tofiledate</i></dt>
347 <dd> 347 <dd>
348 &#109;&#111;&#100;&#105;&#102;&#105;&#99;&#97;&#116;&#105;&#111;&#110; &#116;&#105;&#109;&#101; &#111;&#102; &#116;&#104;&#101; &#115;&#101;&#99;&#111;&#110;&#100; &#102;&#105;&#108;&#101; (&#115;&#116;&#114;&#105;&#110;&#103;) 348 modification time of the second file (string)
349 </dd><dt><i>n</i></dt> 349 </dd><dt><i>n</i></dt>
350 <dd> 350 <dd>
351 &#110;&#117;&#109;&#98;&#101;&#114; &#111;&#102; &#108;&#105;&#110;&#101;&#115; &#111;&#102; &#99;&#111;&#110;&#116;&#101;x&#116; (&#105;&#110;&#116;&#101;&#103;&#101;&#114;) 351 number of lines of context (integer)
352 </dd><dt><i>lineterm</i></dt> 352 </dd><dt><i>lineterm</i></dt>
353 <dd> 353 <dd>
354 &#108;&#105;&#110;&#101; &#116;&#101;&#114;&#109;&#105;&#110;&#97;&#116;&#105;&#111;&#110; &#115;&#116;&#114;&#105;&#110;&#103; (&#115;&#116;&#114;&#105;&#110;&#103;) 354 line termination string (string)
355 </dd> 355 </dd>
356 </dl><dl> 356 </dl><dl>
357 <dt>Returns:</dt> 357 <dt>Returns:</dt>
358 <dd> 358 <dd>
359 &#97; &#103;&#101;&#110;&#101;&#114;&#97;&#116;&#111;&#114; y&#105;&#101;&#108;&#100;&#105;&#110;&#103; &#108;&#105;&#110;&#101;&#115; &#111;&#102; &#100;&#105;&#102;&#102;&#101;&#114;&#101;&#110;&#99;&#101;&#115; 359 a generator yielding lines of differences
360 </dd> 360 </dd>
361 </dl> 361 </dl>
362 <div align="right"><a href="#top">Up</a></div> 362 <div align="right"><a href="#top">Up</a></div>
363 <hr /><hr /> 363 <hr /><hr />
364 <a NAME="unified_diff" ID="unified_diff"></a> 364 <a NAME="unified_diff" ID="unified_diff"></a>
365 <h2>unified_diff</h2> 365 <h2>unified_diff</h2>
366 <b>unified_diff</b>(<i>a, b, fromfile='', tofile='', fromfiledate='', tofiledate='', n=3, lineterm='\n'</i>) 366 <b>unified_diff</b>(<i>a, b, fromfile='', tofile='', fromfiledate='', tofiledate='', n=3, lineterm='\n'</i>)
367 <p> 367 <p>
368 &#67;&#111;&#109;&#112;&#97;&#114;&#101; &#116;w&#111; &#115;&#101;&#113;&#117;&#101;&#110;&#99;&#101;&#115; &#111;&#102; &#108;&#105;&#110;&#101;&#115;&#59; &#103;&#101;&#110;&#101;&#114;&#97;&#116;&#101; &#116;&#104;&#101; &#100;&#101;&#108;&#116;&#97; &#97;&#115; &#97; &#117;&#110;&#105;&#102;&#105;&#101;&#100; &#100;&#105;&#102;&#102;. 368 Compare two sequences of lines; generate the delta as a unified diff.
369 </p><p> 369 </p><p>
370 &#85;&#110;&#105;&#102;&#105;&#101;&#100; &#100;&#105;&#102;&#102;&#115; &#97;&#114;&#101; &#97; &#99;&#111;&#109;&#112;&#97;&#99;&#116; w&#97;y &#111;&#102; &#115;&#104;&#111;w&#105;&#110;&#103; &#108;&#105;&#110;&#101; &#99;&#104;&#97;&#110;&#103;&#101;&#115; &#97;&#110;&#100; &#97; &#102;&#101;w 370 Unified diffs are a compact way of showing line changes and a few
371 &#108;&#105;&#110;&#101;&#115; &#111;&#102; &#99;&#111;&#110;&#116;&#101;x&#116;. &#84;&#104;&#101; &#110;&#117;&#109;&#98;&#101;&#114; &#111;&#102; &#99;&#111;&#110;&#116;&#101;x&#116; &#108;&#105;&#110;&#101;&#115; &#105;&#115; &#115;&#101;&#116; &#98;y '&#110;' w&#104;&#105;&#99;&#104; 371 lines of context. The number of context lines is set by 'n' which
372 &#100;&#101;&#102;&#97;&#117;&#108;&#116;&#115; &#116;&#111; &#116;&#104;&#114;&#101;&#101;. 372 defaults to three.
373 </p><p> 373 </p><p>
374 &#66;y &#100;&#101;&#102;&#97;&#117;&#108;&#116;, &#116;&#104;&#101; &#100;&#105;&#102;&#102; &#99;&#111;&#110;&#116;&#114;&#111;&#108; &#108;&#105;&#110;&#101;&#115; (&#116;&#104;&#111;&#115;&#101; w&#105;&#116;&#104; ---, +++, &#111;&#114; &#64;&#64;) &#97;&#114;&#101; 374 By default, the diff control lines (those with ---, +++, or @@) are
375 &#99;&#114;&#101;&#97;&#116;&#101;&#100; w&#105;&#116;&#104; &#97; &#116;&#114;&#97;&#105;&#108;&#105;&#110;&#103; &#110;&#101;w&#108;&#105;&#110;&#101;. &#84;&#104;&#105;&#115; &#105;&#115; &#104;&#101;&#108;&#112;&#102;&#117;&#108; &#115;&#111; &#116;&#104;&#97;&#116; &#105;&#110;&#112;&#117;&#116;&#115; 375 created with a trailing newline. This is helpful so that inputs
376 &#99;&#114;&#101;&#97;&#116;&#101;&#100; &#102;&#114;&#111;&#109; &#102;&#105;&#108;&#101;.&#114;&#101;&#97;&#100;&#108;&#105;&#110;&#101;&#115;() &#114;&#101;&#115;&#117;&#108;&#116; &#105;&#110; &#100;&#105;&#102;&#102;&#115; &#116;&#104;&#97;&#116; &#97;&#114;&#101; &#115;&#117;&#105;&#116;&#97;&#98;&#108;&#101; &#102;&#111;&#114; 376 created from file.readlines() result in diffs that are suitable for
377 &#102;&#105;&#108;&#101;.w&#114;&#105;&#116;&#101;&#108;&#105;&#110;&#101;&#115;() &#115;&#105;&#110;&#99;&#101; &#98;&#111;&#116;&#104; &#116;&#104;&#101; &#105;&#110;&#112;&#117;&#116;&#115; &#97;&#110;&#100; &#111;&#117;&#116;&#112;&#117;&#116;&#115; &#104;&#97;v&#101; &#116;&#114;&#97;&#105;&#108;&#105;&#110;&#103; 377 file.writelines() since both the inputs and outputs have trailing
378 &#110;&#101;w&#108;&#105;&#110;&#101;&#115;. 378 newlines.
379 </p><p> 379 </p><p>
380 &#70;&#111;&#114; &#105;&#110;&#112;&#117;&#116;&#115; &#116;&#104;&#97;&#116; &#100;&#111; &#110;&#111;&#116; &#104;&#97;v&#101; &#116;&#114;&#97;&#105;&#108;&#105;&#110;&#103; &#110;&#101;w&#108;&#105;&#110;&#101;&#115;, &#115;&#101;&#116; &#116;&#104;&#101; &#108;&#105;&#110;&#101;&#116;&#101;&#114;&#109; 380 For inputs that do not have trailing newlines, set the lineterm
381 &#97;&#114;&#103;&#117;&#109;&#101;&#110;&#116; &#116;&#111; "" &#115;&#111; &#116;&#104;&#97;&#116; &#116;&#104;&#101; &#111;&#117;&#116;&#112;&#117;&#116; w&#105;&#108;&#108; &#98;&#101; &#117;&#110;&#105;&#102;&#111;&#114;&#109;&#108;y &#110;&#101;w&#108;&#105;&#110;&#101; &#102;&#114;&#101;&#101;. 381 argument to "" so that the output will be uniformly newline free.
382 </p><p> 382 </p><p>
383 &#84;&#104;&#101; &#117;&#110;&#105;&#100;&#105;&#102;&#102; &#102;&#111;&#114;&#109;&#97;&#116; &#110;&#111;&#114;&#109;&#97;&#108;&#108;y &#104;&#97;&#115; &#97; &#104;&#101;&#97;&#100;&#101;&#114; &#102;&#111;&#114; &#102;&#105;&#108;&#101;&#110;&#97;&#109;&#101;&#115; &#97;&#110;&#100; &#109;&#111;&#100;&#105;&#102;&#105;&#99;&#97;&#116;&#105;&#111;&#110; 383 The unidiff format normally has a header for filenames and modification
384 &#116;&#105;&#109;&#101;&#115;. &#65;&#110;y &#111;&#114; &#97;&#108;&#108; &#111;&#102; &#116;&#104;&#101;&#115;&#101; &#109;&#97;y &#98;&#101; &#115;&#112;&#101;&#99;&#105;&#102;&#105;&#101;&#100; &#117;&#115;&#105;&#110;&#103; &#115;&#116;&#114;&#105;&#110;&#103;&#115; &#102;&#111;&#114; 384 times. Any or all of these may be specified using strings for
385 '&#102;&#114;&#111;&#109;&#102;&#105;&#108;&#101;', '&#116;&#111;&#102;&#105;&#108;&#101;', '&#102;&#114;&#111;&#109;&#102;&#105;&#108;&#101;&#100;&#97;&#116;&#101;', &#97;&#110;&#100; '&#116;&#111;&#102;&#105;&#108;&#101;&#100;&#97;&#116;&#101;'. &#84;&#104;&#101; &#109;&#111;&#100;&#105;&#102;&#105;&#99;&#97;&#116;&#105;&#111;&#110; 385 'fromfile', 'tofile', 'fromfiledate', and 'tofiledate'. The modification
386 &#116;&#105;&#109;&#101;&#115; &#97;&#114;&#101; &#110;&#111;&#114;&#109;&#97;&#108;&#108;y &#101;x&#112;&#114;&#101;&#115;&#115;&#101;&#100; &#105;&#110; &#116;&#104;&#101; &#102;&#111;&#114;&#109;&#97;&#116; &#114;&#101;&#116;&#117;&#114;&#110;&#101;&#100; &#98;y &#116;&#105;&#109;&#101;.&#99;&#116;&#105;&#109;&#101;(). 386 times are normally expressed in the format returned by time.ctime().
387 </p><p> 387 </p><p>
388 &#69;x&#97;&#109;&#112;&#108;&#101;&#58; 388 Example:
389 </p><p> 389 </p><p>
390 &#60;&#112;&#114;&#101;&#62; 390 <pre>
391 &&#103;&#116;&#59;&&#103;&#116;&#59;&&#103;&#116;&#59; &#102;&#111;&#114; &#108;&#105;&#110;&#101; &#105;&#110; &#117;&#110;&#105;&#102;&#105;&#101;&#100;&#95;&#100;&#105;&#102;&#102;('&#111;&#110;&#101; &#116;w&#111; &#116;&#104;&#114;&#101;&#101; &#102;&#111;&#117;&#114;'.&#115;&#112;&#108;&#105;&#116;(), 391 &gt;&gt;&gt; for line in unified_diff('one two three four'.split(),
392 ... 'z&#101;&#114;&#111; &#111;&#110;&#101; &#116;&#114;&#101;&#101; &#102;&#111;&#117;&#114;'.&#115;&#112;&#108;&#105;&#116;(), '&#79;&#114;&#105;&#103;&#105;&#110;&#97;&#108;', '&#67;&#117;&#114;&#114;&#101;&#110;&#116;', 392 ... 'zero one tree four'.split(), 'Original', 'Current',
393 ... '&#83;&#97;&#116; &#74;&#97;&#110; &#50;&#54; &#50;&#51;&#58;&#51;&#48;&#58;&#53;&#48; &#49;&#57;&#57;&#49;', '&#70;&#114;&#105; &#74;&#117;&#110; &#48;&#54; &#49;&#48;&#58;&#50;&#48;&#58;&#53;&#50; &#50;&#48;&#48;&#51;', 393 ... 'Sat Jan 26 23:30:50 1991', 'Fri Jun 06 10:20:52 2003',
394 ... &#108;&#105;&#110;&#101;&#116;&#101;&#114;&#109;&#61;'')&#58; 394 ... lineterm=''):
395 ... &#112;&#114;&#105;&#110;&#116; &#108;&#105;&#110;&#101; 395 ... print line
396 --- &#79;&#114;&#105;&#103;&#105;&#110;&#97;&#108; &#83;&#97;&#116; &#74;&#97;&#110; &#50;&#54; &#50;&#51;&#58;&#51;&#48;&#58;&#53;&#48; &#49;&#57;&#57;&#49; 396 --- Original Sat Jan 26 23:30:50 1991
397 +++ &#67;&#117;&#114;&#114;&#101;&#110;&#116; &#70;&#114;&#105; &#74;&#117;&#110; &#48;&#54; &#49;&#48;&#58;&#50;&#48;&#58;&#53;&#50; &#50;&#48;&#48;&#51; 397 +++ Current Fri Jun 06 10:20:52 2003
398 &#64; -&#49;,&#52; +&#49;,&#52; &#64;&#64; 398 @ -1,4 +1,4 @@
399 +z&#101;&#114;&#111; 399 +zero
400 &#111;&#110;&#101; 400 one
401 -&#116;w&#111; 401 -two
402 -&#116;&#104;&#114;&#101;&#101; 402 -three
403 +&#116;&#114;&#101;&#101; 403 +tree
404 &#102;&#111;&#117;&#114; 404 four
405 &#60;/&#112;&#114;&#101;&#62; 405 </pre>
406 </p><dl> 406 </p><dl>
407 <dt><i>a</i></dt> 407 <dt><i>a</i></dt>
408 <dd> 408 <dd>
409 &#102;&#105;&#114;&#115;&#116; &#115;&#101;&#113;&#117;&#101;&#110;&#99;&#101; &#111;&#102; &#108;&#105;&#110;&#101;&#115; (&#108;&#105;&#115;&#116; &#111;&#102; &#115;&#116;&#114;&#105;&#110;&#103;&#115;) 409 first sequence of lines (list of strings)
410 </dd><dt><i>b</i></dt> 410 </dd><dt><i>b</i></dt>
411 <dd> 411 <dd>
412 &#115;&#101;&#99;&#111;&#110;&#100; &#115;&#101;&#113;&#117;&#101;&#110;&#99;&#101; &#111;&#102; &#108;&#105;&#110;&#101;&#115; (&#108;&#105;&#115;&#116; &#111;&#102; &#115;&#116;&#114;&#105;&#110;&#103;&#115;) 412 second sequence of lines (list of strings)
413 </dd><dt><i>fromfile</i></dt> 413 </dd><dt><i>fromfile</i></dt>
414 <dd> 414 <dd>
415 &#102;&#105;&#108;&#101;&#110;&#97;&#109;&#101; &#111;&#102; &#116;&#104;&#101; &#102;&#105;&#114;&#115;&#116; &#102;&#105;&#108;&#101; (&#115;&#116;&#114;&#105;&#110;&#103;) 415 filename of the first file (string)
416 </dd><dt><i>tofile</i></dt> 416 </dd><dt><i>tofile</i></dt>
417 <dd> 417 <dd>
418 &#102;&#105;&#108;&#101;&#110;&#97;&#109;&#101; &#111;&#102; &#116;&#104;&#101; &#115;&#101;&#99;&#111;&#110;&#100; &#102;&#105;&#108;&#101; (&#115;&#116;&#114;&#105;&#110;&#103;) 418 filename of the second file (string)
419 </dd><dt><i>fromfiledate</i></dt> 419 </dd><dt><i>fromfiledate</i></dt>
420 <dd> 420 <dd>
421 &#109;&#111;&#100;&#105;&#102;&#105;&#99;&#97;&#116;&#105;&#111;&#110; &#116;&#105;&#109;&#101; &#111;&#102; &#116;&#104;&#101; &#102;&#105;&#114;&#115;&#116; &#102;&#105;&#108;&#101; (&#115;&#116;&#114;&#105;&#110;&#103;) 421 modification time of the first file (string)
422 </dd><dt><i>tofiledate</i></dt> 422 </dd><dt><i>tofiledate</i></dt>
423 <dd> 423 <dd>
424 &#109;&#111;&#100;&#105;&#102;&#105;&#99;&#97;&#116;&#105;&#111;&#110; &#116;&#105;&#109;&#101; &#111;&#102; &#116;&#104;&#101; &#115;&#101;&#99;&#111;&#110;&#100; &#102;&#105;&#108;&#101; (&#115;&#116;&#114;&#105;&#110;&#103;) 424 modification time of the second file (string)
425 </dd><dt><i>n</i></dt> 425 </dd><dt><i>n</i></dt>
426 <dd> 426 <dd>
427 &#110;&#117;&#109;&#98;&#101;&#114; &#111;&#102; &#108;&#105;&#110;&#101;&#115; &#111;&#102; &#99;&#111;&#110;&#116;&#101;x&#116; (&#105;&#110;&#116;&#101;&#103;&#101;&#114;) 427 number of lines of context (integer)
428 </dd><dt><i>lineterm</i></dt> 428 </dd><dt><i>lineterm</i></dt>
429 <dd> 429 <dd>
430 &#108;&#105;&#110;&#101; &#116;&#101;&#114;&#109;&#105;&#110;&#97;&#116;&#105;&#111;&#110; &#115;&#116;&#114;&#105;&#110;&#103; (&#115;&#116;&#114;&#105;&#110;&#103;) 430 line termination string (string)
431 </dd> 431 </dd>
432 </dl><dl> 432 </dl><dl>
433 <dt>Returns:</dt> 433 <dt>Returns:</dt>
434 <dd> 434 <dd>
435 &#97; &#103;&#101;&#110;&#101;&#114;&#97;&#116;&#111;&#114; y&#105;&#101;&#108;&#100;&#105;&#110;&#103; &#108;&#105;&#110;&#101;&#115; &#111;&#102; &#100;&#105;&#102;&#102;&#101;&#114;&#101;&#110;&#99;&#101;&#115; 435 a generator yielding lines of differences
436 </dd> 436 </dd>
437 </dl> 437 </dl>
438 <div align="right"><a href="#top">Up</a></div> 438 <div align="right"><a href="#top">Up</a></div>
439 <hr /> 439 <hr />
440 </body></html> 440 </body></html>

eric ide

mercurial