def med(self, scope, name, command, tokens): try: scope[-1]['announce'][-1].attributes.add(MED(int(tokens.pop(0)))) return True except (IndexError, ValueError): return self.error.set(self.syntax)
def med(tokeniser): value = tokeniser() if not value.isdigit(): raise ValueError('invalid MED %s' % value) return MED(int(value))