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

Class Label



        object --+    
                 |    
objects.FormObject --+
                     |
                    Label

The label class wraps the Perforce label concept.

Instance Methods
 
__init__(self, connection, labelName, form)
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 objects.FormObject: __delitem__, __getitem__, __iter__, __setitem__

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

Static Methods
 
__new__(cls, connection, labelName)
Construct a Label based on the form retrieved on the connection.
Properties

Inherited from object: __class__

Method Details

__new__(cls, connection, labelName)
Static Method

 
Construct a Label based on the form retrieved on the connection.
Parameters:
Returns:
A deferred that fires with a Label object once the form has been retrieved.
Raises:
  • CommandError - If there was a Perforce error querying the label.
Overrides: object.__new__

__init__(self, connection, labelName, form)
(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.
  • form (perforce.forms.Form) - The form retrieved from the Perforce server.
Overrides: objects.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.
Returns:
A deferred that fires when the operation completes.
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.
Returns:
A deferred that fires when the operation completes.
Raises:
  • CommandError - If the operation failed due to Perforce errors.