AutoArchive._mainf._core — AutoArchive Developer Manual (ver. 1.0.4)

# AutoArchive._mainf._core

Internal implementation of Mainf framework.

## Modules

### mainf_engine

`MainfEngine` class.

class `AutoArchive._mainf._core.mainf_engine.` `MainfEngine`

  Bases: `object`

  Manages components and starts the program.

  Contains all components managed by the Mainf framework. Typically, components are added after instantiation of this class. Usage of the class should be followed by calling its `start()` method which creates, initializes and runs components.

  See also the description of _mainf package (`_mainf`).

  `addComponent`(componentType)

    Add a component to be managed by Mainf framework.

    Parameters: | componentType (`type{``IComponent``}`) – A component class that will be added.
    Raises: | TypeError – If `componentType` does not implement `IComponent`.

  `start`(appEnvironment=None)

    Starts the program.

    Creates and initializes components. This method is typically called by a class or function exposed to the startup script.

    See also: `_mainf`, `MainfEngine`.

    Parameters: | appEnvironment (`object`) – An arbitrary object. It will be available to components.
    Returns: | Exit code of the program.
    Return type: | `int`

### _interface_accessor

`_InterfaceAccessor` class.

class `AutoArchive._mainf._core._interface_accessor.` `_InterfaceAccessor`

  Bases: `AutoArchive._mainf.iinterface_accessor.IInterfaceAccessor`

  `IInterfaceAccessor` implementation.

  `getComponentInterface`(interfaceType)

    See: `IInterfaceAccessor.getComponentInterface()`.

  `registerComponentInterface`(interfaceType, instance)

    See: `IInterfaceAccessor.registerComponentInterface()`.

  `unregisterComponentInterface`(interfaceType)

    See: `IInterfaceAccessor.unregisterComponentInterface()`.

### _mainf_context

`_MainfContext` class.

class `AutoArchive._mainf._core._mainf_context.` `_MainfContext`(appEnvironment)

  Bases: `AutoArchive._mainf.imainf_context.IMainfContext`

  `IMainfContext` implementation.

  Parameters: | appEnvironment (`object`) – Object that will be made available via `appEnvironment` property.

  `appEnvironment`

    See: `IMainfContext.appEnvironment`