--- a/src/eric7/Documentation/Source/eric7.Plugins.CheckerPlugins.CodeStyleChecker.Imports.ImportsChecker.html Mon Oct 31 17:54:41 2022 +0100 +++ b/src/eric7/Documentation/Source/eric7.Plugins.CheckerPlugins.CodeStyleChecker.Imports.ImportsChecker.html Tue Nov 01 16:46:35 2022 +0100 @@ -59,6 +59,10 @@ <td>Constructor</td> </tr> <tr> +<td><a href="#ImportsChecker.__atoi">__atoi</a></td> +<td>Private method to convert the given text to an integer number.</td> +</tr> +<tr> <td><a href="#ImportsChecker.__checkBannedImport">__checkBannedImport</a></td> <td>Private method to check import of banned modules.</td> </tr> @@ -103,6 +107,14 @@ <td>Private method to check, if the given module name banned.</td> </tr> <tr> +<td><a href="#ImportsChecker.__naturalKeys">__naturalKeys</a></td> +<td>Private method to generate keys for natural sorting.</td> +</tr> +<tr> +<td><a href="#ImportsChecker.__naturally">__naturally</a></td> +<td>Private method to sort the given list of names naturally.</td> +</tr> +<tr> <td><a href="#ImportsChecker.__tidyImports">__tidyImports</a></td> <td>Private method to check various other import related topics.</td> </tr> @@ -111,9 +123,21 @@ <td>Public method to get a list of modules of the standard library.</td> </tr> <tr> +<td><a href="#ImportsChecker.keyCallback">keyCallback</a></td> +<td></td> +</tr> +<tr> +<td><a href="#ImportsChecker.moduleKey">moduleKey</a></td> +<td>Public method to generate a key for the given module name.</td> +</tr> +<tr> <td><a href="#ImportsChecker.run">run</a></td> <td>Public method to check the given source against miscellaneous conditions.</td> </tr> +<tr> +<td><a href="#ImportsChecker.sorted">sorted</a></td> +<td>Public method to sort the given list of names.</td> +</tr> </table> <h3>Static Methods</h3> @@ -163,6 +187,32 @@ dictionary of arguments for the various checks </dd> </dl> +<a NAME="ImportsChecker.__atoi" ID="ImportsChecker.__atoi"></a> +<h4>ImportsChecker.__atoi</h4> +<b>__atoi</b>(<i>text</i>) + +<p> + Private method to convert the given text to an integer number. +</p> +<dl> + +<dt><i>text</i> (str)</dt> +<dd> +text to be converted +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +integer number +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +int +</dd> +</dl> <a NAME="ImportsChecker.__checkBannedImport" ID="ImportsChecker.__checkBannedImport"></a> <h4>ImportsChecker.__checkBannedImport</h4> <b>__checkBannedImport</b>(<i>node</i>) @@ -377,6 +427,71 @@ bool </dd> </dl> +<a NAME="ImportsChecker.__naturalKeys" ID="ImportsChecker.__naturalKeys"></a> +<h4>ImportsChecker.__naturalKeys</h4> +<b>__naturalKeys</b>(<i>text</i>) + +<p> + Private method to generate keys for natural sorting. +</p> +<dl> + +<dt><i>text</i> (str)</dt> +<dd> +text to generate a key for +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +key for natural sorting +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +list of str or int +</dd> +</dl> +<a NAME="ImportsChecker.__naturally" ID="ImportsChecker.__naturally"></a> +<h4>ImportsChecker.__naturally</h4> +<b>__naturally</b>(<i>toSort, key=None, reverse=False</i>) + +<p> + Private method to sort the given list of names naturally. +</p> +<p> + Note: Natural sorting maintains the sort order of numbers (i.e. + [Q1, Q10, Q2] is sorted as [Q1, Q2, Q10] while the Python + standard sort would yield [Q1, Q10, Q2]. +</p> +<dl> + +<dt><i>toSort</i> (list of str)</dt> +<dd> +list of names to be sorted +</dd> +<dt><i>key</i> (function (optional))</dt> +<dd> +function to generate keys (defaults to None) +</dd> +<dt><i>reverse</i> (bool (optional))</dt> +<dd> +flag indicating a reverse sort (defaults to False) +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +sorted list of names +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +list of str +</dd> +</dl> <a NAME="ImportsChecker.__tidyImports" ID="ImportsChecker.__tidyImports"></a> <h4>ImportsChecker.__tidyImports</h4> <b>__tidyImports</b>(<i></i>) @@ -403,6 +518,36 @@ set of str </dd> </dl> +<a NAME="ImportsChecker.keyCallback" ID="ImportsChecker.keyCallback"></a> +<h4>ImportsChecker.keyCallback</h4> +<b>keyCallback</b>(<i></i>) + +<a NAME="ImportsChecker.moduleKey" ID="ImportsChecker.moduleKey"></a> +<h4>ImportsChecker.moduleKey</h4> +<b>moduleKey</b>(<i>moduleName</i>) + +<p> + Public method to generate a key for the given module name. +</p> +<dl> + +<dt><i>moduleName</i> (str)</dt> +<dd> +module name +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +generated key +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +str +</dd> +</dl> <a NAME="ImportsChecker.run" ID="ImportsChecker.run"></a> <h4>ImportsChecker.run</h4> <b>run</b>(<i></i>) @@ -411,6 +556,40 @@ Public method to check the given source against miscellaneous conditions. </p> +<a NAME="ImportsChecker.sorted" ID="ImportsChecker.sorted"></a> +<h4>ImportsChecker.sorted</h4> +<b>sorted</b>(<i>toSort, key=None, reverse=False</i>) + +<p> + Public method to sort the given list of names. +</p> +<dl> + +<dt><i>toSort</i> (list of str)</dt> +<dd> +list of names to be sorted +</dd> +<dt><i>key</i> (function (optional))</dt> +<dd> +function to generate keys (defaults to None) +</dd> +<dt><i>reverse</i> (bool (optional))</dt> +<dd> +flag indicating a reverse sort (defaults to False) +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +sorted list of names +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +list of str +</dd> +</dl> <div align="right"><a href="#top">Up</a></div> <hr /> </body></html> \ No newline at end of file