The source code browser offers three ways in which to browse your source code: All code by module, all code by class, or only the current file. These are selected from the menu at the top left of the browser.
When browsing project modules, the source browser shows in alphabetical order all Python modules and packages that you have placed into your project and all modules and packages reachable by traversing the directory structure that contains your project files (including all sub-directories). The following types of items are present in this display mode, each of which is displayed with its own icon:
- Packages, which are directories that contain a number of files and a special file __init__.py. This file optionally contains a special variable __all__ that lists the file-level modules Python should automatically import when the package as a whole is imported. See the Python documentation for additional information on creating packages.
- Directories found in your project that do not contain the necessary __init__.py file are shown as directories rather than packages.
- Python files found at any level are shown as modules.
Within each top-level package, directory, or module, the browser will display all sub-modules, sub-directories, modules, and any Python constructs. These are all labeled by generic type, including the following types:
- class -- an object class found in Python source
- method -- a class method
- attribute -- a class or instance attribute
- function -- a function defined at the top-level of a Python module
- variable -- a variable defined at the top-level of a Python module
The icons for these are shown in the Options menu in the top right of the source browser. Note that the base icons are modified in color and with arrows depending on whether they are imported or inherited, and whether they are public, semi-private, or private. This is described in more detail later.
When browsing by class, the browser shows a list of all classes found in the project. Within each class, in addition to a list of derived classes, the methods and attributes for the class are shown.
Navigation to super classes is possible by right-clicking on classes in the display.
The browser can also be asked to restrict the display to only those symbols defined in the current module. This view shows all types of symbols at the top level and allows expansion to visit symbols defined in nested scopes. In this mode, the browser can be used as an index into the current editor file.