Module implementing a checker for import statements.
None |
NameOrderChecker | Class implementing a checker for name ordering. |
None |
Class implementing a checker for name ordering.
Note: Name ordering is checked for import statements, the '__all__' statement and exception names of exception handlers.
Category |
Codes |
None |
NameOrderChecker | Constructor |
__atoi | Private method to convert the given text to an integer number. |
__checkNameOrder | Private method to check the order of import statements and handled exceptions. |
__findErrorInAll | Private method to check the '__all__' node for errors. |
__findExceptionListErrors | Private method to check the exception node for errors. |
__findExceptionListNodes | Private method to find all exception types handled by given tree. |
__findExceptionListStr | Private method to get the exception name out of an exception handler type node. |
__findNodes | Private method to find all import and import from nodes of the given tree. |
__naturalKeys | Private method to generate keys for natural sorting. |
__naturally | Private method to sort the given list of names naturally. |
keyCallback | |
moduleKey | Public method to generate a key for the given module name. |
sorted | Public method to sort the given list of names. |
None |
Constructor
Private method to convert the given text to an integer number.
Private method to check the order of import statements and handled exceptions.
Private method to check the '__all__' node for errors.
Private method to check the exception node for errors.
Private method to find all exception types handled by given tree.
Private method to get the exception name out of an exception handler type node.
Private method to find all import and import from nodes of the given tree.
Private method to generate keys for natural sorting.
Private method to sort the given list of names naturally.
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].
Public method to generate a key for the given module name.
Public method to sort the given list of names.