aria.parser.consumption

Consumption package.

aria.parser.consumption.ConsumptionContext Consumption context.
aria.parser.consumption.Style

Consumers

aria.parser.consumption.Consumer Base class for ARIA consumers.
aria.parser.consumption.ConsumerChain ARIA consumer chain.
aria.parser.consumption.ConsumerException ARIA consumer exception.
aria.parser.consumption.Inputs Fills in the inputs if provided as arguments.
aria.parser.consumption.ServiceTemplate Generates the service template from the presenter.
aria.parser.consumption.Types Used to just dump the types.
aria.parser.consumption.CoerceServiceInstanceValues Coerces values in the service instance.
aria.parser.consumption.ValidateServiceInstance Validates the service instance.
aria.parser.consumption.SatisfyRequirements Satisfies node requirements in the service instance.
aria.parser.consumption.ValidateCapabilities Validates capabilities in the service instance.
aria.parser.consumption.FindHosts Find hosts for all nodes in the service instance.
aria.parser.consumption.ConfigureOperations Configures all operations in the service instance.
aria.parser.consumption.ServiceInstance Generates the service instance by instantiating the service template.
aria.parser.consumption.Read Reads the presentation, handling imports recursively.
aria.parser.consumption.Validate Validates the presentation.
exception aria.parser.consumption.ConsumerException(message=None, cause=None, cause_traceback=None)

Bases: aria.exceptions.AriaException

ARIA consumer exception.

class aria.parser.consumption.ConsumptionContext(set_thread_local=True)

Bases: object

Consumption context.

Variables:
  • args – runtime arguments (usually provided on the command line)
  • out – message output stream (defaults to stdout)
  • style (Style) – message output style
  • validation (ValidationContext) – validation context
  • loading (LoadingContext) – loading context
  • reading (ReadingContext) – reading context
  • presentation (PresentationContext) – presentation context
  • modeling (ModelingContext) – modeling context
get_arg_value(name, default=None)
get_arg_value_int(name, default=None)
static get_thread_local()

Gets the context attached to the current thread if there is one.

has_arg_switch(name)
set_thread_local()

Attaches this context to the current thread.

write(string)

Writes to our out, making sure to encode UTF-8 if required.

class aria.parser.consumption.Style(indentation=2)

Bases: object

indent
static literal(value)
static meta(value)
static node(value)
static property(value)
static section(value)
static type(value)
class aria.parser.consumption.Consumer(context)

Bases: object

Base class for ARIA consumers.

Consumers provide useful functionality by consuming presentations.

consume()
dump()
class aria.parser.consumption.ConsumerChain(context, consumer_classes=None, handle_exceptions=True)

Bases: aria.parser.consumption.consumer.Consumer

ARIA consumer chain.

Calls consumers in order, handling exception by calling _handle_exception on them, and stops the chain if there are any validation issues.

append(*consumer_classes)
consume()
class aria.parser.consumption.Read(context)

Bases: aria.parser.consumption.consumer.Consumer

Reads the presentation, handling imports recursively.

It works by consuming a data source via appropriate Loader, Reader, and Presenter instances.

It supports agnostic raw data composition for presenters that have _get_import_locations and _merge_import.

To improve performance, loaders are called asynchronously on separate threads.

Note that parsing may internally trigger more than one loading/reading/presentation cycle, for example if the agnostic raw data has dependencies that must also be parsed.

consume()
dump()
class aria.parser.consumption.Validate(context)

Bases: aria.parser.consumption.consumer.Consumer

Validates the presentation.

consume()
class aria.parser.consumption.ServiceTemplate(context)

Bases: aria.parser.consumption.consumer.ConsumerChain

Generates the service template from the presenter.

dump()
class aria.parser.consumption.Types(context)

Bases: aria.parser.consumption.consumer.Consumer

Used to just dump the types.

dump()
class aria.parser.consumption.ServiceInstance(context)

Bases: aria.parser.consumption.consumer.ConsumerChain

Generates the service instance by instantiating the service template.

dump()
class aria.parser.consumption.FindHosts(context)

Bases: aria.parser.consumption.consumer.Consumer

Find hosts for all nodes in the service instance.

consume()
class aria.parser.consumption.ValidateServiceInstance(context)

Bases: aria.parser.consumption.consumer.Consumer

Validates the service instance.

consume()
class aria.parser.consumption.ConfigureOperations(context)

Bases: aria.parser.consumption.consumer.Consumer

Configures all operations in the service instance.

consume()
class aria.parser.consumption.SatisfyRequirements(context)

Bases: aria.parser.consumption.consumer.Consumer

Satisfies node requirements in the service instance.

consume()
class aria.parser.consumption.ValidateCapabilities(context)

Bases: aria.parser.consumption.consumer.Consumer

Validates capabilities in the service instance.

consume()
class aria.parser.consumption.CoerceServiceInstanceValues(context)

Bases: aria.parser.consumption.consumer.Consumer

Coerces values in the service instance.

consume()