From 1b98c9c9d0e5fb902801c74928fbaf97a682e715 Mon Sep 17 00:00:00 2001 From: Mathieu Giraud Date: Thu, 30 Jul 2015 18:13:41 +0200 Subject: [PATCH] latex.py, analysis.py: Analysis.missing_clones() --- tools/analysis.py | 6 ++++++ tools/latex.py | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/tools/analysis.py b/tools/analysis.py index 300d0972f..ea0d2f294 100644 --- a/tools/analysis.py +++ b/tools/analysis.py @@ -22,6 +22,12 @@ class Analysis(VidjilJson): for clone in self.d['clones']: self.clones[clone['id']] = clone + def missing_clones(self, lw): + '''Return a set of the clones described in this .analysis but not present into the .vidjil''' + my_clones = set(self.clones.keys()) + lw_clones = set([c.d['id'] for c in lw]) + return my_clones.difference(lw_clones) + def info_of_clone(self, w): if w.d['id'] in self.clones: return self.clones[w.d['id']] diff --git a/tools/latex.py b/tools/latex.py index 458d42438..c664692cc 100644 --- a/tools/latex.py +++ b/tools/latex.py @@ -63,6 +63,10 @@ def main(): if not out: print(r'\\') + if data_analysis: + for c in data_analysis.missing_clones(data): + print('%% !! %s' % c) + print(r' \hline') if __name__ =='__main__': -- GitLab