'Execute wrapped function with table_id temporarily stored as
MSB of command field.'

def splice_table_id(func):

    def splice(self, *args):
        assert (self.command <= 255)
        self.command |= (self.table_id << 8)
        try:
            retval = func(self, *args)
        finally:
            self.table_id = (self.command >> 8)
            self.command &= 255
        return retval
    return splice
