Changeset b2e077a for server/lib/gutenbach/ipp/attributegroup.py
- Timestamp:
- Dec 18, 2011, 11:18:16 PM (12 years ago)
- Branches:
- no-cups
- Children:
- 9eeab06
- Parents:
- d04a689
- git-author:
- Jessica B. Hamrick <jhamrick@…> (12/18/11 23:18:16)
- git-committer:
- Jessica B. Hamrick <jhamrick@…> (12/18/11 23:18:16)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
server/lib/gutenbach/ipp/attributegroup.py
rd04a689 rb2e077a 16 16 """ 17 17 18 def __init__(self, attribute_group_tag=None, attributes=[]):18 def __init__(self, tag=None, attributes=[]): 19 19 """Initialize an AttributeGroup. An AttributeGroup can be 20 20 initialized in three ways: 21 21 22 22 AttributeGroup() 23 AttributeGroup( attribute_group_tag)24 AttributeGroup( attribute_group_tag, attributes)23 AttributeGroup(tag) 24 AttributeGroup(tag, attributes) 25 25 26 26 Arguments: 27 27 28 attribute_group_tag -- a signed char, holds the tag of the29 28 tag -- a signed char, holds the tag of the 29 attribute group 30 30 31 31 attributes -- a list of attributes … … 33 33 """ 34 34 35 if attribute_group_tag is not None: 36 assert isinstance(attribute_group_tag, int), \ 37 "attribute_group_tag must be a character!" 38 35 if tag is not None: 36 assert isinstance(tag, int), \ 37 "tag must be a character!" 39 38 40 self. attribute_group_tag = attribute_group_tag39 self.tag = tag 41 40 self.attributes = [] 42 41 self.extend(attributes) … … 97 96 """ 98 97 99 # conver the attribute_group_tag to binary100 tag = struct.pack('>b', self. attribute_group_tag)98 # convert the tag to binary 99 tag = struct.pack('>b', self.tag) 101 100 102 101 # convert each of the attributes to binary … … 107 106 108 107 def __repr__(self): 109 return '<IPPAttributeGroup (%r, %r)>' % (self. attribute_group_tag, self.attributes)108 return '<IPPAttributeGroup (%r, %r)>' % (self.tag, self.attributes)
Note: See TracChangeset
for help on using the changeset viewer.