]> scripts.mit.edu Git - wizard.git/blobdiff - lib/wizard/command/info.py
Major refactoring of modules and packages to enforce Google style guide.
[wizard.git] / lib / wizard / command / info.py
index ec4331e9c75669cb94c7ef24545ee4c51a43bf2b..14c04c299dd810acaecea0bad8ff15b67d9b3765 100644 (file)
@@ -2,7 +2,7 @@ import optparse
 import sys
 import subprocess
 
-import wizard.deploy as wd
+from wizard import deploy
 
 def prettify(loc):
     return loc.replace("/afs/athena.mit.edu/contrib/scripts", "~scripts")
@@ -24,8 +24,8 @@ including its history and current version."""
         parser.error("too many arguments")
     elif not args:
         parser.error("must specify directory")
-    deploy = wd.Deployment.fromDir(args[0])
-    deploy.getLog() # force the log to be loaded, to pre-empt errors
+    d = deploy.Deployment.fromDir(args[0])
+    d.getLog() # force the log to be loaded, to pre-empt errors
     proc = False
     # This is prime candidate for refactoring. This code pipes
     # stdout to less, so that you get scrolling and stuff.
@@ -35,13 +35,13 @@ including its history and current version."""
     try:
         if options.reverse: munge = lambda x: x
         else: munge = reversed
-        for entry in munge(deploy.getLog()):
+        for entry in munge(d.getLog()):
             print "%s %s" % (entry.version.application.name, entry.version.version)
             print "User: %s" % entry.user
             print "Date: %s" % entry.datetime.strftime("%a %b %0d %H:%M:%S %Y %z")
             print
             info = "Unknown"
-            if isinstance(entry.source, wd.TarballInstall):
+            if isinstance(entry.source, deploy.TarballInstall):
                 info = "Installed with tarball at:\n%s" % \
                     prettify(entry.source.location)
             print indent(info, 4)