Package pybaz :: Class ArchiveLocation
[frames] | no frames]

Class ArchiveLocation

source code

object --+
         |
        ArchiveLocation

A location identified by an url and containing a Bazaar archive.



Instance Methods
 
__eq__(self, other)
Compare equal to instances of ArchiveLocation with the same url.
 
__init__(self, url)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
 
__ne__(self, other)
Logical complement of __eq__.
 
__repr__(self)
repr(x)
 
archive(self)
Archive that is associated to this location.
 
create_master(self, archive, params)
Create a new master archive at this location.
 
create_mirror(self, archive, params)
Create a new archive mirror at this location.
 
is_registered(self)
Is this location registered?...
 
make_mirrorer(self, target)
Create a mirrorer to mirror from this location to the target.
 
meta_info(self, key)
Read a meta-info from this location.
 
register(self)
Register this location.
 
unregister(self)
Unregister this location: :precondition: self.is_registered() :poscondition: not self.is_registered() :raises errors.LocationNotRegistered: this location was not registered.

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __str__

Properties
  url
Url of this location.

Inherited from object: __class__

Method Details

__init__(self, url)
(Constructor)

 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

__repr__(self)
(Representation operator)

 
repr(x)

Overrides: object.__repr__
(inherited documentation)

archive(self)

 
Archive that is associated to this location.

That's a convenience method based on meta_info() that memoises its
result.

:rtype: `Archive`

create_master(self, archive, params)

 
Create a new master archive at this location.

:precondition: not self.is_registered()
    and not archive.is_registered()
    and <url does not exist and is writable>
:postcondition: archive.is_registered() and archive.location == self
    and <url exists>

:type archive: Archive
:type params: ArchiveLocationParams

create_mirror(self, archive, params)

 
Create a new archive mirror at this location.

:precondition: not self.is_registered()
    and <url does not exist and is writable>
:postcondition: self.is_registered()
    and <url exists>

:type archive: Archive
:type params: ArchiveLocationParams

is_registered(self)

 
Is this location registered?

:rtype: bool

make_mirrorer(self, target)

 
Create a mirrorer to mirror from this location to the target.

:param target: specific location the `MirrorMethod` will mirror to.
:type target: `ArchiveLocation`
:rtype: `MirrorMethod`

:raises error.LocationNotRegistered: at least one of self and target is
    not a registered location.
:raises errors.MirrorLocationMismatch: self and target are registered
    locations for different archives.

meta_info(self, key)

 
Read a meta-info from this location.

:precondition: self.is_registered()
:param key: name of the meta-info to read.
:type key: str
:raises errors.MetaInfoError: this location has no such meta-info.
:raises errors.LocationNotRegistered: this location is not registered.

:bug: will raise `errors.MetaInfoError` when the location could not be
    accessed, because baz gives us exit status 1 for ''meta-info not
    present'' and ''could not access location''.

register(self)

 
Register this location.

:precondition: not self.is_registered()
:postcondition: self.is_registered()
:raises errors.LocationAlreadyRegistered: this location was already
    registered.


Property Details

url


Url of this location.

:type: str

Get Method:
pybaz.ArchiveLocation._get_url(self)