]> scripts.mit.edu Git - wizard.git/blobdiff - wizard/install/__init__.py
Move wizard.scripts module to plugins, added hooks accordingly.
[wizard.git] / wizard / install / __init__.py
index 291018cabf143b52b3b78603a6a60a95741964e0..64e3b09588d92bdcd4a68b8110c73b3fa91f0979 100644 (file)
@@ -26,7 +26,7 @@ import sqlalchemy
 import warnings
 
 import wizard
-from wizard import scripts, shell, sql, util
+from wizard import deploy, shell, sql, util
 
 def dsn_callback(options):
     if not isinstance(options.dsn, sqlalchemy.engine.url.URL):
@@ -114,15 +114,20 @@ class EnvironmentStrategy(Strategy):
 
 class ScriptsWebStrategy(Strategy):
     """Performs scripts specific guesses for web variables."""
+    # XXX: This actually isn't too scripts specific
     provides = frozenset(["web_host", "web_path"])
     def __init__(self, dir):
         self.dir = dir
     def prepare(self):
-        """Uses :func:`wizard.scripts.get_web_host_and_path`."""
+        """Uses :func:`deploy.web`."""
         if self.dir is None:
             raise StrategyFailed
-        self._url = scripts.fill_url(self.dir, None)
-        if not self._url:
+        urls = deploy.web(self.dir, None)
+        if not urls:
+            raise StrategyFailed
+        try:
+            self._url = urls.next()
+        except StopIteration:
             raise StrategyFailed
     def execute(self, options):
         """No-op."""
@@ -141,7 +146,7 @@ class ScriptsMysqlStrategy(Strategy):
         self.application = application
         self.dir = dir
     def prepare(self):
-        """Uses :func:`wizard.scripts.get_sql_credentials`"""
+        """Uses the SQL programs in the scripts locker"""
         if self.application.database != "mysql":
             raise StrategyFailed
         try: