]> scripts.mit.edu Git - wizard.git/commitdiff
Add getApplication() function to wizard.app.
authorEdward Z. Yang <ezyang@mit.edu>
Sat, 9 Jan 2010 20:11:00 +0000 (15:11 -0500)
committerEdward Z. Yang <ezyang@mit.edu>
Sat, 9 Jan 2010 20:11:00 +0000 (15:11 -0500)
Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
doc/module/wizard.app.rst
wizard/app/__init__.py
wizard/command/install.py
wizard/command/prepare_pristine.py
wizard/command/research.py

index 7747d90c02c75fe35ad293537c4c3d721cca80c0..8aebea31b09eaa9f1778fb247b564852b93870e2 100644 (file)
@@ -12,6 +12,7 @@ Classes
 
 Functions
 ---------
+.. autofunction:: getApplication
 .. autofunction:: applications
 .. autofunction:: expand_re
 .. autofunction:: make_extractors
index 1d01966363bb45863db242c6f4120fdf7c7c372e..5f318dcde9a86a8884bc7f79bfeef088cfcedbe2 100644 (file)
@@ -51,6 +51,9 @@ def applications():
         _applications = dict([(n,Application.make(n)) for n in _application_list ])
     return _applications
 
+def getApplication(appname):
+    """Retrieves application instance given a name"""
+    return applications()[appname]
 
 class Application(object):
     """
index 6ac1383e202677f89438632d293dbaa3e6a8c568..fa7299aa8957b3b02237a21d4f35623a2a623d1b 100644 (file)
@@ -19,7 +19,7 @@ def main(argv, baton):
         raise DirectoryExistsError
 
     appname, _, version = appstr.partition('-')
-    application = app.applications()[appname]
+    application = app.getApplication(appname)
 
     # get configuration
     schema = application.install_schema
index 80517d1b1c1cc3a6e641231bd9645f0ed1156693..689067607769fe71e02167ae5c5fe8f144cc467b 100644 (file)
@@ -9,7 +9,7 @@ def main(argv, baton):
     check_directory(options)
     if not os.path.exists(args[0]):
         appname, _, version = args[0].partition("-")
-        application = app.applications()[appname]
+        application = app.getApplication(appname)
         url = application.download(version)
         base = os.path.basename(url)
         with open(base, "w") as outfile:
index d36a850923d961f375440c115e59d600982ea401..b81ec465b67bc3db7ad73136d0672d5985850245 100644 (file)
@@ -8,7 +8,7 @@ from wizard import app, command, deploy, shell, util
 def main(argv, baton):
     options, show = parse_args(argv, baton)
     appname = show[0]
-    application = app.applications()[appname]
+    application = app.getApplication(appname)
     deploys = deploy.parse_install_lines(show, options.versions_path)
     stats = {}
     iffy = 0