1.1 --- a/branching.py Fri Oct 07 21:36:08 2016 +0200
1.2 +++ b/branching.py Sat Oct 08 00:33:32 2016 +0200
1.3 @@ -77,14 +77,15 @@
1.4 else:
1.5 return [b for b in self.get_all_suppliers(name) if name in b.assignments]
1.6
1.7 - def set_usage(self, name, attrname):
1.8 + def set_usage(self, name, attrname, invocation=False):
1.9
1.10 """
1.11 - Record usage on the given 'name' of the attribute 'attrname'.
1.12 + Record usage on the given 'name' of the attribute 'attrname', noting the
1.13 + invocation of the attribute if 'invocation' is set to a true value.
1.14 """
1.15
1.16 if self.usage.has_key(name):
1.17 - self.usage[name].add(attrname)
1.18 + self.usage[name].add((attrname, invocation))
1.19
1.20 def get_usage(self):
1.21
1.22 @@ -482,11 +483,12 @@
1.23
1.24 return branch
1.25
1.26 - def use_attribute(self, name, attrname):
1.27 + def use_attribute(self, name, attrname, invocation=False):
1.28
1.29 """
1.30 Indicate the use on the given 'name' of an attribute with the given
1.31 - 'attrname'.
1.32 + 'attrname', optionally involving an invocation of the attribute if
1.33 + 'invocation' is set to a true value.
1.34
1.35 Return all branches that support 'name'.
1.36 """
1.37 @@ -497,7 +499,7 @@
1.38
1.39 if branches.has_key(name):
1.40 for branch in branches[name]:
1.41 - branch.set_usage(name, attrname)
1.42 + branch.set_usage(name, attrname, invocation)
1.43 return branches[name]
1.44 else:
1.45 return None