]> scripts.mit.edu Git - wizard.git/commitdiff
More robust error reporting, add --url flag, add rails as app.
authorEdward Z. Yang <ezyang@mit.edu>
Wed, 14 Apr 2010 20:40:20 +0000 (16:40 -0400)
committerEdward Z. Yang <ezyang@mit.edu>
Wed, 14 Apr 2010 20:40:20 +0000 (16:40 -0400)
Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
wizard/app/__init__.py
wizard/command/list.py
wizard/deploy.py

index a3664dba694ec340bd6334185875eb899e178cfa..87c7b93dabab5fd11c54e8ffe27b11361eb9e608 100644 (file)
@@ -53,6 +53,7 @@ from wizard import resolve, scripts, shell, sql, util
 _scripts_application_list = [
     "mediawiki", "wordpress", "joomla", "e107", "gallery2",
     "phpBB", "advancedbook", "phpical", "trac", "turbogears", "django",
+    "rails",
     # these are technically deprecated
     "advancedpoll", "gallery",
 ]
index bb0ad575d784cd42974972ae09a4aca428766be6..cb2f2b09ac94a08a0c2762550653d05747486d31 100644 (file)
@@ -12,7 +12,10 @@ def main(argv, baton):
             continue
         if options.exists and not os.path.exists(os.path.join(d.location, options.exists)):
             continue
-        print d.location
+        if options.url:
+            print d.url.geturl()
+        else:
+            print d.location
     if errors:
         logging.warning("%d errors, see 'wizard errors --verbose' for details" % errors)
 
@@ -34,6 +37,8 @@ Examples:
     parser = command.WizardOptionParser(usage)
     parser.add_option("-e", "--exists", dest="exists",
             help="only print deployment if FILE exists", metavar="FILE")
+    parser.add_option("--url", dest="url", action="store_true",
+            default=False, help="prints URLs of deployment instead of path")
     baton.push(parser, "versions_path")
     baton.push(parser, "user")
     options, args = parser.parse_all(argv)
index 37a29f08793ebf934737c196f4e3027c084faa9e..6d3ec6702f6ec3bef6520483eb1d1134cb23b52c 100644 (file)
@@ -53,6 +53,11 @@ def parse_install_lines(show, versions_store, yield_errors = False, user = None)
             d = Deployment.parse(line)
             name = d.application.name
         except app.NoSuchApplication as e:
+            if not e.location:
+                try:
+                    e.location = line.split(':')[0]
+                except IndexError:
+                    e.location = line
             if yield_errors:
                 yield e
             continue