Package zeroinstall :: Package injector :: Module model
[frames] | no frames]

Module model

source code

In-memory representation of interfaces and other data structures.

The objects in this module are used to build a representation of an XML interface file in memory.


See Also:
reader constructs these data-structures, http://0install.net/interface-spec.html description of the domain model
Classes
  InvalidInterface
Raised when parsing an invalid feed.
  Stability
A stability rating.
  Restriction
A Restriction limits the allowed implementations of an Interface.
  VersionRestriction
Only select implementations with a particular version number.
  VersionRangeRestriction
Only versions within the given range are acceptable
  VersionExpressionRestriction
Only versions for which the expression is true are acceptable.
  ImpossibleRestriction
A restriction that can never be met.
  DistributionRestriction
A restriction that can only be satisfied by an implementation from the given distribution.
  Binding
Information about how the choice of a Dependency is made known to the application being run.
  EnvironmentBinding
Indicate the chosen implementation using an environment variable.
  ExecutableBinding
Make the chosen command available in $PATH.
  OverlayBinding
Make the chosen implementation available by overlaying it onto another part of the file-system.
  Feed
An interface's feeds are other interfaces whose implementations can also be used as implementations of this interface.
  Dependency
A Dependency indicates that an Implementation requires some additional code to function.
  InterfaceRestriction
A Dependency that restricts the possible choices of a Zero Install interface.
  InterfaceDependency
A Dependency on a Zero Install interface.
  RetrievalMethod
A RetrievalMethod provides a way to fetch an implementation.
  DownloadSource
A DownloadSource provides a way to fetch an implementation.
  RenameStep
A Rename provides a way to rename / move a file within an implementation.
  FileSource
A FileSource provides a way to fetch a single file.
  RemoveStep
A RemoveStep provides a way to delete a path within an implementation.
  Recipe
Get an implementation by following a series of steps.
  DistributionSource
A package that is installed using the distribution's tools (including PackageKit).
  Command
A Command is a way of running an Implementation as a program.
  Implementation
An Implementation is a package which implements an Interface.
  DistributionImplementation
An implementation provided by the distribution.
  ZeroInstallImplementation
An implementation where all the information comes from Zero Install.
  Interface
An Interface represents some contract of behaviour.
  ZeroInstallFeed
A feed lists available implementations of an interface.
  DummyFeed
Temporary class used during API transition.
Functions
Binding
process_binding(e)
Internal
source code
Dependency
process_depends(item, local_feed_dir)
Internal
source code
str
unescape(uri)
Convert each %20 to a space, etc.
source code
str
escape(uri)
Convert each space to %20, etc
source code
[str]
escape_interface_uri(uri)
Convert an interface URI to a list of path components.
source code
str
canonical_iface_uri(uri)
If uri is a relative path, convert to an absolute one.
source code
Variables
  binding_names = frozenset(['environment', 'overlay', 'executab...
  network_offline = 'off-line'
  network_minimal = 'minimal'
  network_full = 'full'
  network_levels = network_offline, network_minimal, network_full
  stability_levels = {}
  defaults = {'PATH': '/bin:/usr/bin', 'XDG_CONFIG_DIRS': '/etc/...
Default values for the 'default' attribute for <environment> bindings of well-known variables.
  insecure = Stability(0, N_('insecure'), _('This is a security ...
  buggy = Stability(5, N_('buggy'), _('Known to have serious bug...
  developer = Stability(10, N_('developer'), _('Work-in-progress...
  testing = Stability(20, N_('testing'), _('Stability unknown - ...
  stable = Stability(30, N_('stable'), _('Tested - no serious pr...
  packaged = Stability(35, N_('packaged'), _('Supplied by the lo...
  preferred = Stability(40, N_('preferred'), _('Best of all - mu...
Function Details

process_binding(e)

source code 

Internal

Parameters:
Returns: Binding

process_depends(item, local_feed_dir)

source code 

Internal

Parameters:
Returns: Dependency

unescape(uri)

source code 

Convert each %20 to a space, etc.

Parameters:
  • uri (str)
Returns: str

escape(uri)

source code 

Convert each space to %20, etc

Parameters:
  • uri (str)
Returns: str

escape_interface_uri(uri)

source code 

Convert an interface URI to a list of path components. e.g. "http://example.com/foo.xml" becomes ["http", "example.com", "foo.xml"], while "file:///root/feed.xml" becomes ["file", "root__feed.xml"] The number of components is determined by the scheme (three for http, two for file). Uses support.escaping.underscore_escape to escape each component.

Parameters:
  • uri (str)
Returns: [str]

canonical_iface_uri(uri)

source code 

If uri is a relative path, convert to an absolute one. A "file:///foo" URI is converted to "/foo". An "alias:prog" URI expands to the URI in the 0alias script Otherwise, return it unmodified.

Parameters:
  • uri (str)
Returns: str
Raises:

Variables Details

binding_names

Value:
frozenset(['environment', 'overlay', 'executable-in-path', 'executable\
-in-var'])

defaults

Default values for the 'default' attribute for <environment> bindings of well-known variables.
Value:
{'PATH': '/bin:/usr/bin', 'XDG_CONFIG_DIRS': '/etc/xdg', 'XDG_DATA_DIR\
S': '/usr/local/share:/usr/share',}

insecure

Value:
Stability(0, N_('insecure'), _('This is a security risk'))

buggy

Value:
Stability(5, N_('buggy'), _('Known to have serious bugs'))

developer

Value:
Stability(10, N_('developer'), _('Work-in-progress - bugs likely'))

testing

Value:
Stability(20, N_('testing'), _('Stability unknown - please test!'))

stable

Value:
Stability(30, N_('stable'), _('Tested - no serious problems found'))

packaged

Value:
Stability(35, N_('packaged'), _('Supplied by the local package manager\
'))

preferred

Value:
Stability(40, N_('preferred'), _('Best of all - must be set manually')\
)