[jhbuild/release-team-commands] New generic FilenamesCheck, to check for presence of some filenames



commit 8d4b315eed231bb676a4b028fd507d3e3e1bfb8a
Author: Frédéric Péters <fpeters 0d be>
Date:   Fri Jan 8 14:21:31 2010 +0100

    New generic FilenamesCheck, to check for presence of some filenames

 jhbuild/commands/goalreport.py |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/jhbuild/commands/goalreport.py b/jhbuild/commands/goalreport.py
index e82fcde..50e770e 100644
--- a/jhbuild/commands/goalreport.py
+++ b/jhbuild/commands/goalreport.py
@@ -230,6 +230,30 @@ class SymbolsCheck(Check):
     create_from_args = classmethod(create_from_args)
 
 
+class FilenamesCheck(Check):
+    def run(self):
+        for base, dirnames, filenames in os.walk(self.module.branch.srcdir):
+            for f in self.filenames:
+                if f in filenames:
+                    self.found = True
+                    self.compute_status()
+                    return
+        self.found = False
+        self.compute_status()
+
+    def compute_status(self):
+        self.status = 'ok'
+        if self.found:
+            self.status = 'todo'
+            self.complexity = 'average'
+
+    def create_from_args(cls, *args):
+        new_class = types.ClassType('FilenamesCheck (%s)' % ', '.join(args),
+                (cls,), {'filenames': args})
+        return new_class
+    create_from_args = classmethod(create_from_args)
+
+
 class DeprecatedSymbolsCheck(SymbolsCheck):
     cached_symbols = {}
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]