You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Environment variables will be stored in an object in the measure plugin. This object will be responsible for storing the values, save them, reload them from a file and notify the measure about the changes in the values (it will be the plugin which will then update the edited measure). Follow a brief description of the Environment object:
to simplify the handling of preferences the Environment object will inherit from HasPreferencesAtom
it will have the following members:
path: path to the file in which to store the environment variables (this should be the path from which the environment was loaded or the last path to which the user manually saved the environment).
updated: an event to which the plugin will listen to know what variable has been added, edited, deleted. The exact format is to be defined.
a EnvNode instance (to be described below) in which the actual variables are stored as EnvVar instance (described below)
it should also have the following methods:
save(path=None): save the values in a config file. if path is None it should use the default. In the absence of a default raise an exception. The extension should be .env.ini
build_from_config(config): class method using a ConfigObj object to rebuild an environment
a method listening to the Node/Entry when a modification occurs, in charge of formatting the message to send to the measure plugin through updated
values(): returning a flat dict containing all the environment variables (in the format env.node_id.var_id) (Note that the id of the root Node should be "env".
As we allow the environment to have a hierarchical structure we need an object to represent nodes in that structure. It will be the EnvNode object whose description follows:
members:
id: id of the node used when formatting the environment variable names to store them in the task database
a list of children that can be either EnvNode or EnvVars (the only delicate thing here is the saving/recovery)
a signal delivering notification about changes in the list of children. Should be connected to environment notifying method. (cf tasks)
a reference to the Environment they belong to.
methods:
values(): returning a flat dict containing all the environment variables below this node (in the format node_id.var_id or node_id.nodebis_id.var_id)
add/move/remove_child: use to manipulate the child list, in charge of connecting observers and signaling the modification.
The env vars for a number cannot simply be stored as key value pairs in a dictionary and are hance stored as EnvVar instances whose description follows:
members:
id: id of the variable basically its name. It should be enforced by the node that ids are unique inside a node.
value: value of the variable that is actually untyped. Changes should be connected to environment notifying method. The saving/restoring of the value should be delegated to the editor declaration (cf Measure: editing environment variables #94 )
a description providing more details about the meaning of the variable.
an editor id: which specifies what editors to use to edit the values, and also how to save restore the value.
a metadata dictionary for additional infos.
The handling of environment variables requires some changes to the measure plugin, workspace and the execution in addition to the actual code storing the variables.
the path to the last used environment needs to be stored on the measure plugin (and saved automatically)
Environment variables will be stored in an object in the measure plugin. This object will be responsible for storing the values, save them, reload them from a file and notify the measure about the changes in the values (it will be the plugin which will then update the edited measure). Follow a brief description of the Environment object:
As we allow the environment to have a hierarchical structure we need an object to represent nodes in that structure. It will be the EnvNode object whose description follows:
The env vars for a number cannot simply be stored as key value pairs in a dictionary and are hance stored as EnvVar instances whose description follows:
The handling of environment variables requires some changes to the measure plugin, workspace and the execution in addition to the actual code storing the variables.
The text was updated successfully, but these errors were encountered: