[CalendarServer-changes] [527] CalendarServer/branches/caladmin-tool/caladmin/script.py

source_changes at macosforge.org source_changes at macosforge.org
Mon Nov 20 10:55:15 PST 2006


Revision: 527
          http://trac.macosforge.org/projects/calendarserver/changeset/527
Author:   dreid at apple.com
Date:     2006-11-20 10:55:14 -0800 (Mon, 20 Nov 2006)

Log Message:
-----------
Use a better subCommand loading method

Modified Paths:
--------------
    CalendarServer/branches/caladmin-tool/caladmin/script.py

Modified: CalendarServer/branches/caladmin-tool/caladmin/script.py
===================================================================
--- CalendarServer/branches/caladmin-tool/caladmin/script.py	2006-11-20 18:22:23 UTC (rev 526)
+++ CalendarServer/branches/caladmin-tool/caladmin/script.py	2006-11-20 18:55:14 UTC (rev 527)
@@ -45,11 +45,13 @@
 
     def parseArgs(self, *rest):
         self.params += rest
+
+    def subCommands(self):
+        return commands.genSubCommandsDef()
+
+    subCommands = property(subCommands)
     
     def postOptions(self):
-        if self.recursing:
-            return
-
         lf = formatters.listFormatters()
         lf.sort()
 
@@ -59,19 +61,6 @@
             raise usage.UsageError("Please specify a valid formatter: %s" % (
                     ', '.join(lf)))
 
-        sc = commands.listCommands()
-        sc.sort()
-
-        self.subCommands = commands.genSubCommandsDef()
-
-        self.recursing = 1
-
-        self.parseOptions(self.params)
-
-        if self.subCommand not in sc:
-            raise usage.UsageError("Please select one of: %s" % (
-                    ', '.join(sc)))
-
     
 def run():
     config = AdminOptions()

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20061120/378f947d/attachment.html


More information about the calendarserver-changes mailing list