def extract(self, state): try: command = self._exscript.getCommandValue().pop() except ValueError: # Command wasn't specified return if command in self._exscript.cmdPosOpts: format = self._exscript.cmdPosOpts[command] pos_opts = self.getPosOpts(state) d = seqIntoDict(pos_opts, format) self._exscript.state.addObjects(d, 'cmdPosOpts')
def setPosOpts(self, pos_opts): seqIntoDict([], pos_opts) self._posOpts = pos_opts
def _extractGetoptPos(self, state, positional): source_name = self.getSourceName() pos_opts = self.posOpts d = seqIntoDict(positional, pos_opts) state.addObjects(d, source_name, positional)