Changeset 5c5fe6d for server/lib/gutenbach/ipp/attributegroup.py
- Timestamp:
- Dec 17, 2011, 5:52:59 PM (12 years ago)
- Branches:
- no-cups
- Children:
- 287d6ec
- Parents:
- 5d24a81
- git-author:
- Jessica B. Hamrick <jhamrick@…> (12/17/11 17:52:59)
- git-committer:
- Jessica B. Hamrick <jhamrick@…> (12/17/11 17:52:59)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
server/lib/gutenbach/ipp/attributegroup.py
rdf51061 r5c5fe6d 8 8 9 9 class AttributeGroup(object): 10 """ 11 An AttributeGroup consists of an attribute-group-tag, followed by 12 a sequence of Attributes. According to RFC 2565, "Within an 10 """An AttributeGroup consists of an attribute-group-tag, followed 11 by a sequence of Attributes. According to RFC 2565, 'Within an 13 12 attribute-sequence, if two attributes have the same name, the 14 first occurrence MUST be ignored. ", so we can effectively treat13 first occurrence MUST be ignored.', so we can effectively treat 15 14 this as an ordered dictionary. 15 16 16 """ 17 17 18 18 def __init__(self, attribute_group_tag=None, attributes=[]): 19 """ 20 Initialize an AttributeGroup. An AttributeGroup can be 19 """Initialize an AttributeGroup. An AttributeGroup can be 21 20 initialized in three ways: 22 21 … … 31 30 32 31 attributes -- a list of attributes 32 33 33 """ 34 34 … … 43 43 44 44 def __getitem__(self, name): 45 """ 46 Returns a list of attributes which have name 'name'.45 """Returns a list of attributes which have name 'name'. 46 47 47 """ 48 48 … … 62 62 63 63 def __setitem__(self, name, attribute): 64 """ 65 Sets an attribute in the attribute group. Note that the key is66 ignored and the attribute is queried for its name.64 """Sets an attribute in the attribute group. Note that the key 65 is ignored and the attribute is queried for its name. 66 67 67 """ 68 68 … … 77 77 78 78 def extend(self, attributes): 79 """ 80 Sets the attributes for the attribute group.79 """Sets the attributes for the attribute group. 80 81 81 """ 82 82 … … 93 93 @property 94 94 def packed_value(self): 95 """ 96 Convert the AttributeGroup to binary.95 """Convert the AttributeGroup to binary. 96 97 97 """ 98 98
Note: See TracChangeset
for help on using the changeset viewer.