eric3.Utilities.ClassBrowsers.pyclbr
Parse a Python file and retrieve classes, functions/methods and attributes.
Parse enough of a Python file to recognize class and method definitions and
to find out the superclasses of a class as well as its attributes.
This is module is based on pyclbr found in the Python 2.2.2 distribution.
Classes
Attribute |
Class to represent a class attribute. |
Class |
Class to represent a Python class. |
Function |
Class to represent a Python function. |
Publics |
Class to represent the list of public identifiers. |
VisibilityMixin |
Mixin class implementing the notion of visibility. |
Functions
_indent |
Module function to return the indentation depth. |
readmodule_ex |
Read a module file and return a dictionary of classes. |
Attribute
Class to represent a class attribute.
Derived from
ClbrBaseClasses.Attribute, VisibilityMixin
Methods
Attribute (Constructor)
Attribute(name)
Constructor
- name
-
name of this attribute
Class
Class to represent a Python class.
Derived from
ClbrBaseClasses.Class, VisibilityMixin
Methods
Class (Constructor)
Class(module, name, super, file, lineno)
Constructor
- file
-
filename containing this class
- lineno
-
linenumber of the class definition
- module
-
name of the module containing this class
- name
-
name of this class
- super
-
list of class names this class is inherited from
Function
Class to represent a Python function.
Derived from
ClbrBaseClasses.Function, VisibilityMixin
Methods
Function (Constructor)
Function(module, name, file, lineno, signature = '', separator = ', ')
Constructor
- file
-
filename containing this class
- lineno
-
linenumber of the class definition
- module
-
name of the module containing this function
- name
-
name of this function
- separator
-
string separating the parameters
- signature
-
parameterlist of the method
Publics
Class to represent the list of public identifiers.
Derived from
None
Methods
Publics (Constructor)
Publics(module, file, lineno, idents)
Constructor
- file
-
filename containing this class
- idents
-
list of public identifiers
- lineno
-
linenumber of the class definition
- module
-
name of the module containing this function
VisibilityMixin
Mixin class implementing the notion of visibility.
Derived from
ClbrBaseClasses.ClbrVisibilityMixinBase
Methods
VisibilityMixin (Constructor)
VisibilityMixin()
Method to initialize the visibility.
_indent
_indent(ws, _expandtabs=string.expandtabs)
Module function to return the indentation depth.
- _expandtabs
-
callable object used to expand tab characters
- ws
-
the whitespace to be checked (string)
- Returns:
-
length of the whitespace string (integer)
readmodule_ex
readmodule_ex(module, path=[], inpackage=0)
Read a module file and return a dictionary of classes.
Search for MODULE in PATH and sys.path, read and parse the
module and return a dictionary with one entry for each class
found in the module.
- inpackage
-
flag indicating a module inside a package is scanned
- module
-
name of the module file (string)
- path
-
path the module should be searched in (list of strings)
- Returns:
-
the resulting dictionary