Example #1
0
 def addparam(self, name, value='', mandatory=True):
     if self._generated is not None:
         raise error.ReadOnlyPartError('part is being generated')
     if name in self._seenparams:
         raise ValueError('duplicated params: %s' % name)
     self._seenparams.add(name)
     params = self._advisoryparams
     if mandatory:
         params = self._mandatoryparams
     params.append((name, value))
Example #2
0
 def __setdata(self, data):
     if self._generated is not None:
         raise error.ReadOnlyPartError('part is being generated')
     self._data = data