Glossary¶
- external variable¶
CondConfigParser variable that is defined by the calling application and passed as part of a context argument to specific CondConfigParser methods. A notorious method using a context argument is
RawConditionalConfig.eval().In a configuration file, an external variable can be used in variable assignments and predicates without being itself explicitely defined in the configuration file. See Variable assignments for more details.
External variables are a kind of
variablein the formal grammar (which does not distinguish them from other variables).- context¶
Mapping from external variable names to their values. Such a mapping is passed by the application using CondConfigParser to methods such as
RawConditionalConfig.eval(). The context needs not be the same during the life of aRawConditionalConfiginstance: the configuration file can be evaluated for different combinations of the values of external variables.- predicate¶
Boolean expression enclosed in square brackets (
[and]).Each conditional section of the configuration file starts with a predicate. If, in a given context, the predicate for a given section is true, its raw configuration lines are considered to be applicable and methods such as
RawConditionalConfig.eval()include them in their output. Otherwise, the raw configuration lines are normally ignored.See Conditional sections for an informal description of the role of predicates in the configuration file format and
predicatefor the definition in the formal grammar.- raw configuration line¶
- option¶
A line of the configuration file that is not processed by CondConfigParser, except for the removal of leading spaces. Such lines are passed to the calling application or ignored depending on whether the predicate of the section that contains them is true or false.
Raw configuration lines are sometimes called options because in the application for which CondConfigParser was written (initially FGo!, now FFGo), each such line corresponds to an option for the fgfs executable (which belongs to FlightGear). It is also more convenient to talk about “default, unconditional options” and “conditional options” than it is using the equivalent expressions based on the longer phrase “raw configuration lines”.
See Default raw configuration lines for a description of how raw configuration lines are recognized and
rawConfigLinefor use in the formal grammar.- applicable configuration line¶
raw configuration line belonging to a section whose predicate is true in a given context.
The main point of
RawConditionalConfig.eval()(and to a larger extent of CondConfigParser) is to evaluate the predicate of each section of the configuration file in order to return the applicable configuration lines.