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.
  VersionRangeRestriction
Only versions within the given range are acceptable
  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.
  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.
  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.
  Recipe
Get an implementation by following a series of steps.
  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
 
process_binding(e)
Internal
source code
 
process_depends(item)
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
canonical_iface_uri(uri)
If uri is a relative path, convert to an absolute one.
source code
tuple (opaque)
parse_version(version_string)
Convert a version string to an internal representation.
source code
str
format_version(version)
Format a parsed version for display.
source code
Variables
  binding_names = frozenset(['environment'])
  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, 'insecure', 'This is a security risk')
  buggy = Stability(5, 'buggy', 'Known to have serious bugs')
  developer = Stability(10, 'developer', 'Work-in-progress - bug...
  testing = Stability(20, 'testing', 'Stability unknown - please...
  stable = Stability(30, 'stable', 'Tested - no serious problems...
  packaged = Stability(35, 'packaged', 'Supplied by the local pa...
  preferred = Stability(40, 'preferred', 'Best of all - must be ...
Function Details

canonical_iface_uri(uri)

source code 

If uri is a relative path, convert to an absolute one. Otherwise, return it unmodified.

Returns: str
Raises:

parse_version(version_string)

source code 

Convert a version string to an internal representation. The parsed format can be compared quickly using the standard Python functions.

  • Version := DottedList ("-" Mod DottedList?)*
  • DottedList := (Integer ("." Integer)*)
Returns: tuple (opaque)
Raises:

Since: 0.24 (moved from reader, from where it is still available):

format_version(version)

source code 

Format a parsed version for display. Undoes the effect of parse_version.

Returns: str

See Also: Implementation.get_version

Since: 0.24


Variables Details

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',}

developer

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

testing

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

stable

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

packaged

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

preferred

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