Package perforce :: Module objects :: Class Label
[frames] | no frames]

Class Label



object --+    
         |    
FormObject --+
             |
            Label

The label class wraps the Perforce label concept.

Instance Methods
 
__init__(self, connection, labelName)
Intialise the Label based on the form retrieved on the connection.
 
save(self, force=False)
Save any changes made to the label on the Perforce server.
 
delete(self, force=False)
Delete this label from the Perforce server.

Inherited from FormObject: __delitem__, __getitem__, __iter__, __setitem__

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

Properties

Inherited from object: __class__

Method Details

__init__(self, connection, labelName)
(Constructor)

 
Intialise the Label based on the form retrieved on the connection.
Parameters:
  • connection (perforce.connection.Connection) - The connection to the Perforce server to use. Must be already connected.
  • labelName (str or unicode) - The name of the label to query.
Raises:
  • CommandError - If there was a Perforce error querying the label.
Overrides: FormObject.__init__

save(self, force=False)

 

Save any changes made to the label on the Perforce server.

By default a locked label can only be updated by its owner. Passing force as True will allow users with 'admin' access to force saving changes to the labe.
Parameters:
  • force (boolean) - Flag indicating whether to force saving of updates.
Raises:
  • CommandError - If the operation failed due to Perforce errors.

delete(self, force=False)

 

Delete this label from the Perforce server.

By default a locked label can't be deleted. Users with 'admin' access can force deletion of a locked label by specifying force as True.
Parameters:
  • force (boolean) - Flag indicating whether to force deletion of a locked label.
Raises:
  • CommandError - If the operation failed due to Perforce errors.