1.1 --- a/micropython/table.py Mon Jul 28 00:26:29 2008 +0200
1.2 +++ b/micropython/table.py Tue Jul 29 00:20:23 2008 +0200
1.3 @@ -206,6 +206,36 @@
1.4 row.append(attributes.get(name))
1.5 return row
1.6
1.7 + def all_attribute_positions(self, name):
1.8 +
1.9 + """
1.10 + Return a list of positions for the attribute with the given 'name' from
1.11 + all known objects.
1.12 + """
1.13 +
1.14 + all = set()
1.15 + for attributes in self.table.values():
1.16 + if attributes.has_key(name):
1.17 + all.add(attributes[name])
1.18 + return all
1.19 +
1.20 + def all_possible_objects(self, names):
1.21 +
1.22 + """
1.23 + Return a list of object names supporting the given attribute 'names'.
1.24 + """
1.25 +
1.26 + possible = []
1.27 + for objname, attributes in self.table.items():
1.28 + found = 1
1.29 + for name in names:
1.30 + if not attributes.has_key(name):
1.31 + found = 0
1.32 + break
1.33 + if found:
1.34 + possible.append(objname)
1.35 + return possible
1.36 +
1.37 def as_list(self):
1.38
1.39 """