[sysadmin-bin] ftpadmin: lazily init maintainers data and cleanup install progress



commit 5a00ef49e15e620eef4bf88481331e09b3b63b63
Author: Olav Vitters <olav vitters nl>
Date:   Sat Mar 19 17:52:30 2011 +0100

    ftpadmin: lazily init maintainers data and cleanup install progress

 ftpadmin |   19 +++++++++++++------
 1 files changed, 13 insertions(+), 6 deletions(-)
---
diff --git a/ftpadmin b/ftpadmin
index c7dd56e..f7356d5 100755
--- a/ftpadmin
+++ b/ftpadmin
@@ -574,11 +574,16 @@ class ModuleInfo(DirectoryInfo):
         relpath = os.path.join(self.section, self.module)
         DirectoryInfo.__init__(self, relpath, limit_module=module)
 
-        # Determine maintainers
-        self.maintainers = []
-        data = get_module_info(self.module)
-        if len(data):
-            self.maintainers = data[0][1]['maintainerUid']
+    @property
+    def maintainers(self):
+        if not hasattr(self, '_maintainers'):
+            # Determine maintainers
+            self._maintainers = []
+            data = get_module_info(self.module)
+            if len(data):
+                self._maintainers = data[0][1]['maintainerUid']
+
+        return self._maintainers
 
     @property
     def versions(self):
@@ -751,6 +756,8 @@ Install %s? [Y/n]""" % self.module,
                 if not self.confirm_install():
                     return False
 
+
+            print "Installing %s:" % self.basename
         #        if not os.path.isdir(self.destination):
         #            os.makedirs(self.destination, 042775) # drwxrwsr-x
                 # XXX - install the tarball
@@ -961,7 +968,7 @@ def cmd_install(options, parser):
         module.install(unattended=options.unattended)
         print ""
 
-    print """Please report any problems while running this script to:
+    print """Please report any problems to:
 https://bugzilla.gnome.org/enter_bug.cgi?product=sysadmin""";
 
 def cmd_show_info(options, parser):



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]