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:
Arthur O'Dwyer
2017-05-01 15:28:38 -07:00
parent 25d73785de
commit ecc2c2e407
3 changed files with 8 additions and 3 deletions

View File

@ -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):