From: Edward Z. Yang Date: Sun, 25 Apr 2010 00:52:55 +0000 (-0400) Subject: Doc update, fix bug in prepare-new. X-Git-Url: https://scripts.mit.edu/gitweb/wizard.git/commitdiff_plain/23a9093a401649961d73e7303bf8ef1929c6547e Doc update, fix bug in prepare-new. Signed-off-by: Edward Z. Yang --- diff --git a/doc/create.rst b/doc/create.rst index 0295383..826c2b1 100644 --- a/doc/create.rst +++ b/doc/create.rst @@ -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:: diff --git a/doc/module/wizard.install.rst b/doc/module/wizard.install.rst index c3800d0..9a10184 100644 --- a/doc/module/wizard.install.rst +++ b/doc/module/wizard.install.rst @@ -18,6 +18,8 @@ Predefined classes ------------------ .. autoclass:: WebArgSet :show-inheritance: +.. autoclass:: WebStubArgSet + :show-inheritance: .. autoclass:: DbArgSet :show-inheritance: .. autoclass:: AdminArgSet diff --git a/wizard/command/prepare_new.py b/wizard/command/prepare_new.py index fa302b8..88ab0d4 100644 --- a/wizard/command/prepare_new.py +++ b/wizard/command/prepare_new.py @@ -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 diff --git a/wizard/install/__init__.py b/wizard/install/__init__.py index 685121d..11b4599 100644 --- a/wizard/install/__init__.py +++ b/wizard/install/__init__.py @@ -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.