The pragma.py
module#
Summary#
Get the pragma ID of an object. |
|
Get the pragma for an object. |
|
Deserialize a text pragma containing a JSON document to a Python object. |
|
Get the text of the pragma ID for an object. |
|
Get the text of the pragma for an object. |
|
Remove the pragma ID from an object. |
|
Remove the pragma from an object. |
|
Serialize a Python object to a JSON document in a textual pragma. |
|
Update the pragma ID of an object with a new ID. |
|
Update the pragma ID which text starts with |
Description#
Provides accessors for textual pragmas.
A textual pragma is made of an identifier, usually related to a tool, and a text. The syntax and semantic of the text are specific to each tool. This library provides sets of accessors for several kinds of textual pragmas:
Generic pragmas: Any text.
Core tools pragmas: The text has the form
<key> [<text>]
. These core tools includekcg
andmc
.JSON pragmas: The text is an abribrary data formatted as JSON, usually a dictionary.
Notes:
This module assumes that the pragmas of a model element are unique per
<id>
or per(<id>, <key>)
for core tools pragmas.This module assumes that the value of a pragma that is not present is empty, instead of raising an exception. Thus, it automatically removes a pragma when its new value is empty.
This module wraps some existing functions of the SCADE Suite Python API that are not documented or listed in the Script Wizardβs tables.
The editing functions return whether the model is modified.