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

Module reader

source code

Parses an XML interface into a Python representation.

Functions
bool
update_from_cache(interface)
Read a cached interface and any native feeds or user overrides.
source code
 
update_user_overrides(interface, main_feed=None)
Update an interface with user-supplied information.
source code
int
check_readable(interface_uri, source)
Test whether an interface file is valid.
source code
 
update(interface, source, local=False)
Read in information about an interface.
source code
Function Details

update_from_cache(interface)

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.

update_user_overrides(interface, main_feed=None)

source code 

Update an interface with user-supplied information.

Parameters:
  • interface (model.Interface) - the interface object to update
  • main_feed - feed to update with last_checked information

Note: feed updates shouldn't really be here. main_feed may go away in future.

check_readable(interface_uri, source)

source code 

Test whether an interface file is valid.

Parameters:
  • interface_uri (str) - the interface's URI
  • 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)

source code 

Read in information about an interface.

Parameters:
  • interface (model.Interface) - the interface object to update
  • source (str) - the name of the file to read
  • local - use file's mtime for last-modified, and uri attribute is ignored
Returns:
the new feed (since 0.32)
Raises:

See Also: update_from_cache, which calls this