]> scripts.mit.edu Git - wizard.git/commitdiff
Doc update, fix bug in prepare-new.
authorEdward Z. Yang <ezyang@mit.edu>
Sun, 25 Apr 2010 00:52:55 +0000 (20:52 -0400)
committerEdward Z. Yang <ezyang@mit.edu>
Sun, 25 Apr 2010 00:52:55 +0000 (20:52 -0400)
Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
doc/create.rst
doc/module/wizard.install.rst
wizard/command/prepare_new.py
wizard/install/__init__.py

index 02953831665c25df803003a7737a6334c1916e83..826c2b14c47e5e81e377ceb26deb5fb58ec64e42 100644 (file)
@@ -156,6 +156,7 @@ crib in this case::
 
     cp /mit/scripts/deploy/php.ini/wordpress php.ini
     athrun scripts fix-php-ini
+    git add .
 
 Now commit, but don't get too attached to your commit; we're going
 to be heavily modifying it soon::
index c3800d0c0f7568d56b641310bcbc2a92057510f7..9a1018479269d550995d8cfa0b4f8524eff53b90 100644 (file)
@@ -18,6 +18,8 @@ Predefined classes
 ------------------
 .. autoclass:: WebArgSet
     :show-inheritance:
+.. autoclass:: WebStubArgSet
+    :show-inheritance:
 .. autoclass:: DbArgSet
     :show-inheritance:
 .. autoclass:: AdminArgSet
index fa302b88507fae4595ee283b8e3ae04b8989df49..88ab0d4c3f61bdd5570b037e68604ffb0126dcf8 100644 (file)
@@ -1,7 +1,7 @@
 import os
 import os.path
 
-from wizard import command
+from wizard import command, shell
 
 def main(argv, baton):
     options, args = parse_args(argv, baton)
@@ -9,6 +9,7 @@ def main(argv, baton):
         raise Exception("Not in root directory of Git working copy")
     os.mkdir(".scripts")
     open(".scripts/.htaccess", "w").write("Deny from all\n")
+    shell.call("git", "add", ".scripts")
 
 def parse_args(argv, baton):
     usage = """usage: %prog prepare-new
index 685121d51b63ca325083ae48199ec4c41acbcad9..11b4599a4425c2d1b304893dd6fca3e6c39479dc 100644 (file)
@@ -53,19 +53,6 @@ def fetch(options, path, post=None):
     """
     return util.fetch(options.web_host, options.web_path, path, post)
 
-def preloads():
-    """
-    Retrieves a dictionary of string names to precanned :class:`ArgSet` objects.
-    """
-    return {
-            'web': WebArgSet(),
-            'webstub': WebStubArgSet(),
-            'db': DbArgSet(),
-            'admin': AdminArgSet(),
-            'email': EmailArgSet(),
-            'title': TitleArgSet(),
-            }
-
 class Strategy(object):
     """
     Represents a strategy for calculating arg values without user input.
@@ -177,6 +164,7 @@ class ScriptsEmailStrategy(Strategy):
         """Uses :envvar:`USER` and assumes you are an MIT affiliate."""
         # XXX: should double-check that you're on a scripts server
         # and fail if you're not.
+        # XXX: This might be buggy, because locker might be set to USER
         self._user = os.getenv("USER")
         if self._user is None:
             raise StrategyFailed
@@ -278,14 +266,30 @@ class TitleArgSet(ArgSet):
                     prompt="Please decide on a title for your new website."),
                 ]
 
+def preloads():
+    """
+    Retrieves a dictionary of string names to precanned :class:`ArgSet` objects.
+    """
+    return {
+            'web': WebArgSet(),
+            'webstub': WebStubArgSet(),
+            'db': DbArgSet(),
+            'admin': AdminArgSet(),
+            'email': EmailArgSet(),
+            'title': TitleArgSet(),
+            }
+
 class ArgSchema(object):
     """
     Schema container for arguments.
 
     Valid identifiers for subclasses of :class:`ArgSet` are:
 
-    * ``mysql``, which populates the options ``mysql_host``, ``mysql_db``,
-      ``mysql_user`` and ``mysql_password``.
+    * ``webstub``, which populates ``web_stub_path``.
+    * ``db``, which populates the option ``dsn``, which is a SQLAlchemy
+      database source name, with properties for ``drivername``,
+      ``username``, ``password``, ``host``, ``port``, ``database`` and
+      ``query``.
     * ``admin``, which populates the options ``admin_name`` and
       ``admin_password``.
     * ``email``, which populates the option ``email``.
@@ -295,7 +299,7 @@ class ArgSchema(object):
 
     Example::
 
-        parser = ArgHandler("mysql", "admin", "email")
+        parser = ArgHandler("db", "admin", "email")
         parser.add(Arg("title", help="Title of the new application"))
     """
     #: Dictionary of argument names to :class:`Arg` objects in schema.