Class G.c.t.Tag:

Part of GTG.core.tagstore View In Hierarchy

A short name that can be applied to Tasks.

I mean, surely you must know what a tag is by now. Think Gmail, del.icio.us, Flickr et al.

A tag is defined by its name, which in most cases is @something. A tag can also have multiple arbitrary attributes. The only attribute enforced for tags is name, which always matches Tag.get_name().

Method __init__ Construct a tag.
Method get_name Return the name of the tag.
Method set_attribute Set an arbitrary attribute.
Method get_attribute Get the attribute att_name.
Method get_all_attributes Return a list of all attribute names.
Method __str__ Undocumented
def __init__(self, name, save_cllbk=None):
Construct a tag.
ParametersnameThe name of the tag. Should be a string, generally a short one.
save_cllbkA nullary callable, called whenever an attribute is set.
def get_name(self):
Return the name of the tag.
def set_attribute(self, att_name, att_value):
Set an arbitrary attribute.

This will call the save_cllbk callback passed to the constructor.

Parametersatt_nameThe name of the attribute.
att_valueThe value of the attribute. Will be converted to a string.
def get_attribute(self, att_name):
Get the attribute att_name.

Returns None if there is no attribute matching att_name.

def get_all_attributes(self, butname=False):
Return a list of all attribute names.
ParametersbutnameIf True, exclude name from the list of attribute names.
def __str__(self):
Undocumented
API Documentation for GTG, generated by pydoctor at 2009-07-19 21:37:32.