From: Edward Z. Yang Date: Sun, 17 Jul 2011 05:02:31 +0000 (-0400) Subject: Don't register strategies which are redundant. X-Git-Url: https://scripts.mit.edu/gitweb/wizard.git/commitdiff_plain/e8c31e84e1e2a3e873dd8d9f6812dfe667a93e8e Don't register strategies which are redundant. Signed-off-by: Edward Z. Yang --- diff --git a/TODO b/TODO index 65347ce..8b85d27 100644 --- a/TODO +++ b/TODO @@ -1,5 +1,4 @@ -- Environment variables don't seem to be overriding plugin - strategies; rejigger the order. +- Strategy introspection and disabling. - prepare-config (and others) create .wizard dir even when not strictly necessary - Bug out immediately if tags are not present in the master tip diff --git a/wizard/install/__init__.py b/wizard/install/__init__.py index 1f68e74..972dc3b 100644 --- a/wizard/install/__init__.py +++ b/wizard/install/__init__.py @@ -305,6 +305,14 @@ class ArgSchema(object): for strategy_cls in raw_strategies: try: strategy = strategy_cls(self, application, dir, web_stub_path) + # don't bother with strategies who are already + # fully handled + if strategy.provides <= self.provides: + # this could exacerbate a bug in a strategy + # which thinks that it's OK post prepare, but + # actually isn't. There's now not an easy way to + # say "don't actually run that strategy, please. + continue strategy.prepare() self.provides |= strategy.provides self.strategies.append(strategy)