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

Class Branch

source code

         object --+            
                  |            
    NamespaceObject --+        
                      |        
            ArchiveItem --+    
                          |    
               CategoryItem --+
                              |
     object --+               |
              |               |
NamespaceObject --+           |
                  |           |
        ArchiveItem --+       |
                      |       |
              Setupable --+   |
                          |   |
         object --+       |   |
                  |       |   |
    NamespaceObject --+   |   |
                      |   |   |
       RevisionIterable --+   |
                          |   |
                    Package --+
                              |
         object --+           |
                  |           |
    NamespaceObject --+       |
                      |       |
       RevisionIterable --+   |
                          |   |
            VersionIterable --+
                              |
                             Branch

Arch branch namespace object.

:see: `Archive`, `Category`, `Version`, `Revision`



Instance Methods
 
__getitem__(self, v)
Instanciate a version belonging to this branch.
 
__init__(self, name)
Create a Branch object from its name.
 
as_version(self)
Deprecated.
 
exists(self)
Does this namespace exists? Within the Arch model, history cannot be changed: created archive entries cannot be deleted.
 
get_library_versions(self, reverse=False)
Deprecated.
 
get_versions(self, reverse=False)
Deprecated.
 
iter_library_versions(self, reverse=False)
Iterate over library revisions.
 
iter_versions(self, reverse=False)
Iterate over archive versions.
 
latest_version(self)
Latest version in this branch.

Inherited from CategoryItem: get_category

Inherited from Package: as_revision, latest_revision

Inherited from Setupable: setup

Inherited from ArchiveItem: get_archive, get_fullname, get_nonarch

Inherited from VersionIterable: iter_library_revisions, iter_revisions

Inherited from NamespaceObject: __eq__, __ne__, __repr__, __str__

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

Properties
  library_versions
Deprecated.
  versions
Deprecated.

Inherited from CategoryItem: category

Inherited from ArchiveItem: archive, fullname, nonarch

Inherited from object: __class__

Method Details

__getitem__(self, v)
(Indexing operator)

 
Instanciate a version belonging to this branch.

For example ``Branch('jdoe@example.com/frob--devel')['0']`` is
equivalent to ``Branch('jdoe@example.com/frob--devel--0')``.

:param v: branch id.
:type v: str
:rtype: `Version`

:raise NamespaceError: argument is not a valid version id.

__init__(self, name)
(Constructor)

 
Create a Branch object from its name.

:param name: fully-qualified branch name, like
    "jdoe@example.com--2004/frob--devo" or
    "jdoe@example.com--2004/frob".
:type name: str
:raise errors.NamespaceError: ``name`` is not a valid branch name.

Overrides: ArchiveItem.__init__

as_version(self)

 
Deprecated.

Latest version in this branch.

:rtype: `Version`
:precondition: `self.exists()` returns ``True``
:precondition: `self.iter_versions` yields at least one object.
:raise IndexError: this branch is empty.
:see: `latest_version`

exists(self)

 
Does this namespace exists?

Within the Arch model, history cannot be changed: created archive
entries cannot be deleted. However, it is possible to ``unregister`` an
archive, or to find references to archives whose location is not known.
Thus, existence cannot always be decided. Testing for the existence of
a name in a non-registered archive raises
`errors.ArchiveNotRegistered`.

:return: whether this namespace object exists.
:rtype: bool
:raise errors.ArchiveNotRegistered: the archive name is not registered,
    so existence cannot be decided.
:raise errors.ExecProblem: there was a problem accessing the archive.

Overrides: NamespaceObject.exists
(inherited documentation)

get_library_versions(self, reverse=False)

 
Deprecated.

Versions in this branch present in the library.

:rtype: tuple of `Version`
:see: `iter_library_versions`

get_versions(self, reverse=False)

 
Deprecated.

Versions in this branch.

:rtype: tuple of `Version`
:see: `iter_versions`

iter_library_versions(self, reverse=False)

 
Iterate over library revisions.

:param reverse: reverse order, higher versions first.
:type reverse: bool
:return: versions in this namespace which are present in the
    revision library.
:rtype: iterable of `Version`

Overrides: VersionIterable.iter_library_versions
(inherited documentation)

iter_versions(self, reverse=False)

 
Iterate over archive versions.

:param reverse: reverse order, higher versions first.
:type reverse: bool
:return: all existing versions in this namespace.
:rtype: iterable of `Version`

:precondition: `self.exists()` returns ``True``.

Overrides: VersionIterable.iter_versions
(inherited documentation)

latest_version(self)

 
Latest version in this branch.

:rtype: `Version`
:precondition: `self.exists()` returns ``True``
:precondition: `self.iter_versions` yields at least one object.
:raise ValueError: the archive is not registered, or this branch does
    not exist, or it contains no version.


Property Details

library_versions


Deprecated.

Versions in this branch present in the library.

:type: tuple of `Version`
:see: `iter_library_versions`

Get Method:
pybaz.Branch._get_library_versions(self)

versions


Deprecated.

Versions in this branch.

:type: tuple of `Version`
:see: `iter_versions`

Get Method:
pybaz.Branch._get_versions(self)