add_slot(self,
fieldname,
purpose,
slotnum=None)
| source code
|
Allocate a slot number for the given field and purpose.
If a slot number is already allocated for this field and purpose, this
has no effect.
Returns the slot number allocated for the field and purpose (whether
newly allocated, or previously allocated).
If slotnum is supplied, the number contained in it is used to
allocate the new slot, instead of allocating a new number. No checks
will be made to ensure that the slot number doesn't collide with
existing (or later allocated) numbers: the main purpose of this
parameter is to share allocations - ie, to collide deliberately.
|