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

Module reader

source code

Parses an XML feed into a Python representation. You should probably use iface_cache.iface_cache rather than the functions here.

Classes
  MissingLocalFeed
Functions
bool
update_from_cache(interface, iface_cache=None)
Read a cached interface and any native feeds or user overrides.
source code
ZeroInstallFeed | None
load_feed_from_cache(url, selections_ok=False)
Load a feed.
source code
 
update_user_feed_overrides(feed)
Update a feed with user-supplied information.
source code
 
update_user_overrides(interface, known_site_feeds=frozenset())
Update an interface with user-supplied information.
source code
int
check_readable(feed_url, source)
Test whether a feed file is valid.
source code
ZeroInstallFeed
update(interface, source, local=False, iface_cache=None)
Read in information about an interface.
source code
ZeroInstallFeed
load_feed(source, local=False, selections_ok=False)
Load a feed from a local file.
source code
Function Details

update_from_cache(interface, iface_cache=None)

source code 

Read a cached interface and any native feeds or user overrides.

Parameters:
Returns: bool
True if cached version and user overrides loaded OK. False if upstream not cached. Local interfaces (starting with /) are always considered to be cached, although they are not actually stored in the cache.

Note: internal; use iface_cache.IfaceCache.get_interface instread.

load_feed_from_cache(url, selections_ok=False)

source code 

Load a feed. If the feed is remote, load from the cache. If local, load it directly.

Parameters:
  • url (str)
  • selections_ok (bool)
Returns: ZeroInstallFeed | None
the feed, or None if it's remote and not cached.

update_user_feed_overrides(feed)

source code 

Update a feed with user-supplied information. Sets last_checked and user_stability ratings.

Parameters:

update_user_overrides(interface, known_site_feeds=frozenset())

source code 

Update an interface with user-supplied information. Sets preferred stability and updates extra_feeds.

Parameters:
  • interface (model.Interface) - the interface object to update
  • known_site_feeds ({str}) - feeds to ignore (for backwards compatibility)

check_readable(feed_url, source)

source code 

Test whether a feed file is valid.

Parameters:
  • feed_url (str) - the feed's expected URL
  • source (str) - the name of the file to test
Returns: int
the modification time in src (usually just the mtime of the file)
Raises:

update(interface, source, local=False, iface_cache=None)

source code 

Read in information about an interface. Deprecated.

Parameters:
Returns: ZeroInstallFeed
the new feed (since 0.32)
Raises:

See Also: update_from_cache, which calls this

load_feed(source, local=False, selections_ok=False)

source code 

Load a feed from a local file.

Parameters:
  • source (str) - the name of the file to read
  • local (bool) - this is a local feed
  • selections_ok (bool) - if it turns out to be a local selections document, return that instead
Returns: ZeroInstallFeed
the new feed
Raises:

Since: 0.48

See Also: iface_cache.iface_cache, which uses this to load the feeds