##// END OF EJS Templates
bundle2: introduce an ``_initparams`` method...
Pierre-Yves David -
r21608:3cb96ca9 default
parent child Browse files
Show More
@@ -706,6 +706,11 b' class unbundlepart(unpackermixin):'
706 data = self._fromheader(struct.calcsize(format))
706 data = self._fromheader(struct.calcsize(format))
707 return _unpack(format, data)
707 return _unpack(format, data)
708
708
709 def _initparams(self, mandatoryparams, advisoryparams):
710 """internal function to setup all logic related parameters"""
711 self.mandatoryparams = mandatoryparams
712 self.advisoryparams = advisoryparams
713
709 def _readheader(self):
714 def _readheader(self):
710 """read the header and setup the object"""
715 """read the header and setup the object"""
711 typesize = self._unpackheader(_fparttypesize)[0]
716 typesize = self._unpackheader(_fparttypesize)[0]
@@ -732,8 +737,7 b' class unbundlepart(unpackermixin):'
732 advparams = []
737 advparams = []
733 for key, value in advsizes:
738 for key, value in advsizes:
734 advparams.append((self._fromheader(key), self._fromheader(value)))
739 advparams.append((self._fromheader(key), self._fromheader(value)))
735 self.mandatoryparams = manparams
740 self._initparams(manparams, advparams)
736 self.advisoryparams = advparams
737 ## part payload
741 ## part payload
738 def payloadchunks():
742 def payloadchunks():
739 payloadsize = self._unpack(_fpayloadsize)[0]
743 payloadsize = self._unpack(_fpayloadsize)[0]
General Comments 0
You need to be logged in to leave comments. Login now