def create_methods(self): """Method that should provide MethodMeta instances for Block Yields: tuple: (string name, MethodMeta, callable post_function). """ return get_method_decorated(self)
def make_return_table(self, part_tasks): # Filter part tasks so that we only run the ones hooked to us columns = OrderedDict(name=StringArrayMeta("Part name")) for part in part_tasks: hooked = [ method_name for (method_name, hook, _) in get_hook_decorated(part) if hook is self ] for method_name, method_meta, func in get_method_decorated(part): if method_name in hooked: # Add return metas to the table columns for arg_name in method_meta.returns.elements: md = method_meta.returns.elements[arg_name].to_dict() if "ArrayMeta" in md["typeid"]: md["tags"] = md["tags"] + ["hook:return_array"] else: md["typeid"] = md["typeid"].replace( "Meta", "ArrayMeta") meta = deserialize_object(md, VArrayMeta) if arg_name in columns: column_d = columns[arg_name].to_dict() assert column_d == md, \ "%s != %s" % (column_d, md) columns[arg_name] = meta meta = TableMeta("Part returns from hook", columns=columns) return_table = Table(meta) return return_table
def create_methods(self): """Method that should provide MethodMeta instances for Block Yields: tuple: (string name, MethodMeta, callable post_function). """ return get_method_decorated(self)
def create_methods(self): hooked = [name for (name, _, _) in get_hook_decorated(self)] for name, method_meta, func in get_method_decorated(self): self.method_metas[name] = method_meta if name not in hooked: yield name, method_meta, func
def create_methods(self): hooked = [name for (name, _, _) in get_hook_decorated(self)] for name, method_meta, func in get_method_decorated(self): self.method_metas[name] = method_meta if name not in hooked: yield name, method_meta, func