gump-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From leosim...@apache.org
Subject svn commit: r125789 - /gump/branches/Gump3/gump /gump/branches/Gump3/pygump/main.py /gump/branches/Gump3/pygump/python/gump/test/mockobjects.py
Date Thu, 20 Jan 2005 17:02:39 GMT
Author: leosimons
Date: Thu Jan 20 09:02:37 2005
New Revision: 125789

URL: http://svn.apache.org/viewcvs?view=rev&rev=125789
Log:
* Hmm. Something was wrong with the tests. Things compile again now. Another hmm.

* document 'gump run' properly using optparse built-in functionality.

* remove the --project for now as its not actually supported.
Modified:
   gump/branches/Gump3/gump
   gump/branches/Gump3/pygump/main.py
   gump/branches/Gump3/pygump/python/gump/test/mockobjects.py

Modified: gump/branches/Gump3/gump
Url: http://svn.apache.org/viewcvs/gump/branches/Gump3/gump?view=diff&rev=125789&p1=gump/branches/Gump3/gump&r1=125788&p2=gump/branches/Gump3/gump&r2=125789
==============================================================================
--- gump/branches/Gump3/gump	(original)
+++ gump/branches/Gump3/gump	Thu Jan 20 09:02:37 2005
@@ -76,17 +76,9 @@
       ;;
     run)
       echo "
-      Run pygump.
-
-      Usage:
-        $0 run [gump.py-args ...]
-
-      See http://wiki.apache.org/gump/GumpCommandLineOptions for more
-      information about the options pygump accepts. The one mandatory
-      argument is the "project expression" detailing what to run. You
-      will usually want "all" here.
+Run pygump.
 "
-# TODO: document Pygump CLI args!
+      do_run "from main import print_help; print_help()" $@
       ;;
     kill)
       echo "

Modified: gump/branches/Gump3/pygump/main.py
Url: http://svn.apache.org/viewcvs/gump/branches/Gump3/pygump/main.py?view=diff&rev=125789&p1=gump/branches/Gump3/pygump/main.py&r1=125788&p2=gump/branches/Gump3/pygump/main.py&r2=125789
==============================================================================
--- gump/branches/Gump3/pygump/main.py	(original)
+++ gump/branches/Gump3/pygump/main.py	Thu Jan 20 09:02:37 2005
@@ -48,8 +48,11 @@
 ERROR = 2
 CRITICAL = 1
 
+def print_help():
+    parser = get_parser()
+    parser.print_help()
 
-def get_parser(_homedir, _hostname, _projects, _workdir, _logdir, _workspace):
+def get_parser(_homedir=None, _hostname=None, _projects=None, _workdir=None, _logdir=None,
_workspace=None):
     """Pygump uses the optparse package to provide the CLI.
     
     To add new options to pygump, change this method and document the changes
@@ -65,35 +68,39 @@
     """
     # TODO: make sure no CLI settings are overridden!
     from optparse import OptionParser
-    parser = OptionParser()
+    usage = "$0 run [options ...]"
+
+    parser = OptionParser(usage=usage)
     parser.add_option("--debug",
                       action="store_true",
-                      default=False)
+                      default=False,
+                      help="print extra information")
     parser.add_option("--homedir",
                       action="store",
-                      default=_homedir)
+                      default=_homedir,
+                      help="the base directory for gump")
     parser.add_option("--hostname",
                       action="store",
-                      default=_hostname)
-    parser.add_option("-p",
-                      "--project",
-                      action="append",
-                      dest="projects",
-                      default=_projects)
+                      default=_hostname,
+                      help="the hostname gump will use")
     parser.add_option("--workdir",
                       action="store",
-                      default=_workdir)
+                      default=_workdir,
+                      help="the working directory gump will use")
     parser.add_option("--logdir",
                       action="store",
-                      default=_logdir)
+                      default=_logdir,
+                      help="the directory gump will write logs to")
     parser.add_option("-w",
                       "--workspace",
                       action="store",
-                      default=_workspace)
+                      default=_workspace,
+                      help="absolute path to the workspace gump will use")
     parser.add_option("--no-updates",
                       action="store_true",
                       dest="no_updates",
-                      default=False)
+                      default=False,
+                      help="skip cvs and svn updates")
     return parser
 
 

Modified: gump/branches/Gump3/pygump/python/gump/test/mockobjects.py
Url: http://svn.apache.org/viewcvs/gump/branches/Gump3/pygump/python/gump/test/mockobjects.py?view=diff&rev=125789&p1=gump/branches/Gump3/pygump/python/gump/test/mockobjects.py&r1=125788&p2=gump/branches/Gump3/pygump/python/gump/test/mockobjects.py&r2=125789
==============================================================================
--- gump/branches/Gump3/pygump/python/gump/test/mockobjects.py	(original)
+++ gump/branches/Gump3/pygump/python/gump/test/mockobjects.py	Thu Jan 20 09:02:37 2005
@@ -59,19 +59,15 @@
         pass
 
 class MockRun:
-    def __init__(self,workspace,options,gumpSet):
+    def __init__(self,workspace,options):
         self.workspace = workspace
         self.options = options
-        self.gumpSet = gumpSet
         
     def getWorkspace(self):
         return self.workspace
     
     def getOptions(self):
         return self.options
-    
-    def getGumpSet(self):
-        return self.gumpSet
 
 class MockDatabase:
     def __init__(self):
@@ -85,8 +81,7 @@
         self.log = MockLog()
         self.workspace = MockWorkspace()
         self.options = MockOptions()
-        self.gumpSet = MockGumpSet()
-        self.run = MockRun(self.workspace,self.options,self.gumpSet)
+        self.run = MockRun(self.workspace,self.options)
         self.cursor = MockCursor()
         self.conn = MockConnection(self.cursor)
         self.database = MockDatabase()

Mime
View raw message