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

Class Category

source code

         object --+            
                  |            
    NamespaceObject --+        
                      |        
            ArchiveItem --+    
                          |    
                  Setupable --+
                              |
     object --+               |
              |               |
NamespaceObject --+           |
                  |           |
   RevisionIterable --+       |
                      |       |
        VersionIterable --+   |
                          |   |
             BranchIterable --+
                              |
                             Category

Arch category namespace object.

:see: `Archive`, `Branch`, `Version`, `Revision`



Instance Methods
 
__getitem__(self, b)
Instanciate a branch belonging to this category.
 
__init__(self, name)
Create a category object from its name.
 
exists(self)
Does this namespace exists? Within the Arch model, history cannot be changed: created archive entries cannot be deleted.
 
get_branches(self)
Deprecated.
 
get_library_branches(self)
Deprecated.
 
iter_branches(self)
Iterate over archive branches.
 
iter_library_branches(self)
Iterate over library branches.

Inherited from Setupable: setup

Inherited from ArchiveItem: get_archive, get_fullname, get_nonarch

Inherited from BranchIterable: iter_library_versions, iter_versions

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
  branches
Deprecated.
  library_branches
Deprecated.

Inherited from ArchiveItem: archive, fullname, nonarch

Inherited from object: __class__

Method Details

__getitem__(self, b)
(Indexing operator)

 
Instanciate a branch belonging to this category.

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

:param b: branch id.
:type b: str
:rtype: `Category`

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

__init__(self, name)
(Constructor)

 
Create a category object from its name.

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

Overrides: ArchiveItem.__init__

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_branches(self)

 
Deprecated.

Branches in this category.

:rtype: tuple of `Branch`
:see: `iter_branches`

get_library_branches(self)

 
Deprecated.

Branches in this category present in the library.

:rtype: tuple of `Branch`
:see: `iter_library_branches`

iter_branches(self)

 
Iterate over archive branches.

:return: all existing branches in this namespace.
:rtype: iterable of `Branch`
:precondition: `self.exists()` returns ``True``.

Overrides: BranchIterable.iter_branches
(inherited documentation)

iter_library_branches(self)

 
Iterate over library branches.

:return: branches in this namespace which are present in the
    revision library.
:rtype: iterable of `Branch`

Overrides: BranchIterable.iter_library_branches
(inherited documentation)

Property Details

branches


Deprecated.

Branches in this category.

:type: tuple of `Branch`
:see: `Category.iter_branches`

Get Method:
pybaz.Category._get_branches(self)

library_branches


Deprecated.

Branches in this category present in the library.

:type: tuple of `Branch`
:see: `Category.iter_branches`

Get Method:
pybaz.Category._get_library_branches(self)