Welcome | Get started | Dive | Contribute | Topics | Reference | Changes | More

lino.utils.diag

Some diagnostic utilities.

Module Attributes

analyzer

This is a docstring

Functions

elem_label(e)

layout_fields(ba)

py2rst(self[, doctestfmt, fmt])

Return a textual representation of the given Python object as a reStructuredText bullet list.

visible_for(ba)

Shows a list of user profiles for which this action is visible.

Classes

Analyzer()

The class of the lino.utils.diag.analyzer object.

class lino.utils.diag.Analyzer

Bases: object

The class of the lino.utils.diag.analyzer object.

show_window_fields()

List all window actions and the form fields they contain.

show_window_permissions()

List all window actions and the user types that can see them.

show_memo_commands(doctestfmt=False)

List the memo commands defined in this application.

show_database_structure(sort_fields=False, sort_models=True)

Show a bullet list of all models and their fields.

Both the list of models and the fields of each model can optionally be sorted alphabetically. The models are sorted by default, the fields not.

show_db_overview()

Print a reStructredText-formatted “database overview” report. Used by test cases in tested documents.

show_foreign_keys()

Return a list that shows how database objects are being referred to by some other database object. This information is important (1) before deleting objects and (2) when merging them.

For every model we see a list of “delete handlers” and a list of fields from other models that point to this model using that delete handler.

Delete handlers are:

  • PROTECT : refuse to delete when other objects refer to this object

  • CASCADE : delete objects refering to this object

  • set_on_delete : make other objects point to something else (or set their pointer to None)

get_complexity_factors(today=None)

Yield a series of plain text lines that describe the complexity factors of this application.

lino.utils.diag.visible_for(ba)

Shows a list of user profiles for which this action is visible.

lino.utils.diag.py2rst(self, doctestfmt=False, fmt=None)

Return a textual representation of the given Python object as a reStructuredText bullet list.

The Python object can be a layout, a layout element, an action or a database object.

If it is an action, it must have parameters, and py2rst will render the params_layout.

If it is a database object, you will get a textual representation of a detail window on that object.

If the optional argument doctestfmt is specified as True, then output contains less blank lines, which might be invalid reStructuredText but is more doctest-friendly.

TODO: move this functionality to lino.api.doctests and rename it to something that reflects better what it does.

lino.utils.diag.analyzer = <lino.utils.diag.Analyzer object>

This is a docstring