Show
Ignore:
Timestamp:
07/04/08 18:45:23 (5 years ago)
Author:
getxsick
Message:

Added set_fields() method for Protocol and few utils functions

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branch/UMPA/umpa/packets.py

    r3078 r3082  
    2525    you want to send.''' 
    2626 
    27     def _add_new_protocols(*protos): 
    28         for p in protos: 
    29             self.protos.append(p) 
    30  
    3127    def __init__(self, *protos): 
    3228        '''You can include some protocols objects in construtor 
     
    3632        self._add_new_protocols(protos) 
    3733 
    38     def include(self, *protos): 
    39         '''You can add protocols into your packet. 
    40         ''' 
    41         self._add_new_protocols(protos) 
    4234    def __str__(self): 
    4335        '''Prints in human-readable style a content of the packet.''' 
     
    4840        for p in self.protos: 
    4941            print p 
     42 
     43    def include(self, *protos): 
     44        '''You can add protocols into your packet. 
     45        ''' 
     46        self._add_new_protocols(protos) 
     47 
     48    def _add_new_protocols(*protos): 
     49        for p in protos: 
     50            self.protos.append(p)