rope.base.libutils
A few useful functions for using rope as a library
Functions
|
Get the resource at path |
|
|
|
|
|
Report that the contents of file at path was changed |
|
Perform static object analysis on a python file in the project |
|
Perform static object analysis on all python files in the project |
|
Returns a PyObject object for the given code |
|
Returns a Scope object for the given code |
|
|
|
Module Contents
- rope.base.libutils.path_to_resource(project, path, type=None)
Get the resource at path
You only need to specify type if path does not exist. It can be either ‘file’ or ‘folder’. If the type is None it is assumed that the resource already exists.
Note that this function uses Project.get_resource(), Project.get_file(), and Project.get_folder() methods.
- rope.base.libutils.path_relative_to_project_root(project, path)
- rope.base.libutils.relative(root, path)
- rope.base.libutils.report_change(project, path, old_content)
Report that the contents of file at path was changed
The new contents of file is retrieved by reading the file.
- rope.base.libutils.analyze_module(project, resource)
Perform static object analysis on a python file in the project
Note that this might be really time consuming.
- rope.base.libutils.analyze_modules(project, task_handle=taskhandle.DEFAULT_TASK_HANDLE)
Perform static object analysis on all python files in the project
Note that this might be really time consuming.
- rope.base.libutils.get_string_module(project, code, resource=None, force_errors=False)
Returns a PyObject object for the given code
If force_errors is True, exceptions.ModuleSyntaxError is raised if module has syntax errors. This overrides
ignore_syntax_errorsproject config.
- rope.base.libutils.get_string_scope(project, code, resource=None)
Returns a Scope object for the given code
- rope.base.libutils.is_python_file(project, resource)
- rope.base.libutils.modname(resource)