Ignore:
Timestamp:
Dec 18, 2011, 11:18:16 PM (12 years ago)
Author:
Jessica B. Hamrick <jhamrick@…>
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)
Message:

Refactor code to handle the operations a little bit more logically

File:
1 edited

Legend:

Unmodified
Added
Removed
  • server/lib/gutenbach/ipp/attributegroup.py

    rd04a689 rb2e077a  
    1616    """
    1717
    18     def __init__(self, attribute_group_tag=None, attributes=[]):
     18    def __init__(self, tag=None, attributes=[]):
    1919        """Initialize an AttributeGroup.  An AttributeGroup can be
    2020        initialized in three ways:
    2121
    2222            AttributeGroup()
    23             AttributeGroup(attribute_group_tag)
    24             AttributeGroup(attribute_group_tag, attributes)
     23            AttributeGroup(tag)
     24            AttributeGroup(tag, attributes)
    2525
    2626        Arguments:
    2727
    28             attribute_group_tag -- a signed char, holds the tag of the
    29                                    attribute group
     28            tag -- a signed char, holds the tag of the
     29                   attribute group
    3030
    3131            attributes -- a list of attributes
     
    3333        """
    3434
    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!"
    3938
    40         self.attribute_group_tag = attribute_group_tag
     39        self.tag = tag
    4140        self.attributes = []
    4241        self.extend(attributes)
     
    9796        """
    9897
    99         # conver the attribute_group_tag to binary
    100         tag = struct.pack('>b', self.attribute_group_tag)
     98        # convert the tag to binary
     99        tag = struct.pack('>b', self.tag)
    101100
    102101        # convert each of the attributes to binary
     
    107106
    108107    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.