Add report_workspace() to Reporter, and remove dead rules from the workspace.
I think the change to `workspace.breakRule()` is harmless. In theory, it should make Copycat less hesitant to come up with rules that conflict with the already-broken rule.
This commit is contained in:
@ -138,7 +138,7 @@ class Workspace(object):
|
||||
def slippages(self):
|
||||
result = []
|
||||
if self.changedObject and self.changedObject.correspondence:
|
||||
result = self.changedObject.correspondence.conceptMappings[:]
|
||||
result += self.changedObject.correspondence.conceptMappings
|
||||
for o in self.initial.objects:
|
||||
if o.correspondence:
|
||||
for mapping in o.correspondence.slippages():
|
||||
@ -147,13 +147,15 @@ class Workspace(object):
|
||||
return result
|
||||
|
||||
def buildRule(self, rule):
|
||||
if self.rule:
|
||||
if self.rule is not None:
|
||||
self.structures.remove(self.rule)
|
||||
self.rule = rule
|
||||
self.structures += [rule]
|
||||
rule.activateRuleDescriptions()
|
||||
|
||||
def breakRule(self):
|
||||
if self.rule is not None:
|
||||
self.structures.remove(self.rule)
|
||||
self.rule = None
|
||||
|
||||
def buildDescriptions(self, objekt):
|
||||
|
||||
Reference in New Issue
Block a user