]> scripts.mit.edu Git - wizard.git/blobdiff - wizard/command/research.py
Hookify research interface.
[wizard.git] / wizard / command / research.py
index add825b44e8278fae20738e19fc46ffd7a22902c..a95c32fcd07f7333a7f11600c6d51b9ca6cb9dc9 100644 (file)
@@ -3,10 +3,12 @@ import traceback
 import itertools
 import random
 
-from wizard import command, deploy, shell, util
+from wizard import app, command, deploy, shell, util
 
 def main(argv, baton):
     options, show = parse_args(argv, baton)
+    appname = show[0]
+    application = app.applications()[appname]
     sh = shell.Shell()
     deploys = deploy.parse_install_lines(show, options.versions_path)
     stats = {}
@@ -35,19 +37,7 @@ def main(argv, baton):
                         if deleted == '-': continue
                         added = int(added)
                         deleted = int(deleted)
-                        # hook
-                        if filename == "LocalSettings.php":
-                            if added == deleted == 10:
-                                continue
-                            elif added == deleted == 9:
-                                continue
-                        elif filename == "AdminSettings.php":
-                            if added == 0 and deleted == 20:
-                                continue
-                        elif filename == "config/index.php" or filename == "config/index.php5":
-                            if added == 0:
-                                continue
-                        if not added and not deleted:
+                        if not added and not deleted or application.researchFilter(filename, added, deleted):
                             continue
                         results.append((added,deleted,filename))
                     if len(results) > options.filter:
@@ -59,8 +49,7 @@ def main(argv, baton):
                     for added,deleted,filename in results:
                         stats.setdefault(filename, 0)
                         stats[filename] += 1
-                        # hook
-                        if filename == "LocalSettings.php" and not options.verbose:
+                        if application.researchVerbose(filename) and not options.verbose:
                             continue
                         print "%-7d %-7d %s/%s" % (added,deleted,d.location,filename)
             except (deploy.NotConfiguredError, deploy.NotMigratedError):