Return-Path: Mailing-List: contact gump-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list gump@jakarta.apache.org Received: (qmail 28383 invoked by uid 500); 28 Apr 2003 07:30:29 -0000 Received: (qmail 28379 invoked from network); 28 Apr 2003 07:30:29 -0000 Received: from icarus.apache.org (208.185.179.13) by daedalus.apache.org with SMTP; 28 Apr 2003 07:30:29 -0000 Received: (qmail 28442 invoked by uid 1464); 28 Apr 2003 07:30:28 -0000 Date: 28 Apr 2003 07:30:28 -0000 Message-ID: <20030428073028.28441.qmail@icarus.apache.org> From: nicolaken@apache.org To: jakarta-gump-cvs@apache.org Subject: cvs commit: jakarta-gump/python build.py gen.py gumpconf.py gumpcore.py gumputil.py gumpview.py X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N nicolaken 2003/04/28 00:30:28 Modified: python/ruper __init__.py python build.py gen.py gumpconf.py gumpcore.py gumputil.py gumpview.py Log: Switch to using logging and remove the default.debug config property. Still need to switch to configfile-specified. Revision Changes Path 1.2 +5 -5 jakarta-gump/python/ruper/__init__.py Index: __init__.py =================================================================== RCS file: /home/cvs/jakarta-gump/python/ruper/__init__.py,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- __init__.py 27 Apr 2003 13:16:27 -0000 1.1 +++ __init__.py 28 Apr 2003 07:30:26 -0000 1.2 @@ -106,9 +106,9 @@ if os.path.exists('%s/%s' % (destinationDir,resource.standardName())): log.debug('using cached file') else: - if default.debug: print 'caching file...' + log.debug('caching file...') download((self, resource, destinationDir)) - if default.debug: print '...done' + log.debug('...done') # Resource class Resource(object): 1.13 +6 -2 jakarta-gump/python/build.py Index: build.py =================================================================== RCS file: /home/cvs/jakarta-gump/python/build.py,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- build.py 28 Apr 2003 00:36:52 -0000 1.12 +++ build.py 28 Apr 2003 07:30:26 -0000 1.13 @@ -11,10 +11,15 @@ """ -import os.path,os,sys +import os.path,os,sys,logging from gumpcore import * from gumpconf import * +# init logging +logging.basicConfig() +log = logging.getLogger(__name__) +log.setLevel(logging.DEBUG) #set verbosity to show all messages of severity >= DEBUG + # dump all dependencies to build a project to the output def dumpDeps(workspace, projectname): @@ -59,7 +64,6 @@ workspace.sync = default.syncCommand execString = workspace.sync + ' ' + sourcedir + ' ' + destdir - #if default.debug: print 'Synchronizing:', execString # TODO: don't just brag about it! #exec( execString ) 1.14 +6 -1 jakarta-gump/python/gen.py Index: gen.py =================================================================== RCS file: /home/cvs/jakarta-gump/python/gen.py,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- gen.py 27 Apr 2003 21:54:05 -0000 1.13 +++ gen.py 28 Apr 2003 07:30:27 -0000 1.14 @@ -3,9 +3,14 @@ Generate the merged XML description of the workspace """ -import os.path,os,sys +import os.path,os,sys,logging from gumpcore import * from gumpconf import * + +# init logging +logging.basicConfig() +log = logging.getLogger(__name__) +log.setLevel(logging.DEBUG) #set verbosity to show all messages of severity >= DEBUG ######################################################################### # Dump the object module as XML # 1.12 +1 -2 jakarta-gump/python/gumpconf.py Index: gumpconf.py =================================================================== RCS file: /home/cvs/jakarta-gump/python/gumpconf.py,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- gumpconf.py 27 Apr 2003 21:54:05 -0000 1.11 +++ gumpconf.py 28 Apr 2003 07:30:27 -0000 1.12 @@ -3,7 +3,7 @@ Global configuration settings for gump, done as Python classes """ -import socket, time, os, os.path, sys +import socket, time, os, os.path,sys class dir: cmdpath = os.path.abspath(sys.argv[0]) @@ -21,7 +21,6 @@ project = "krysalis-ruper-test" merge = os.path.normpath('%s/%s' % (dir.work, 'merge.xml')) date = time.strftime('%Y%m%d') - debug = True antCommand = 'java org.apache.tools.ant.Main -Dbuild.sysclasspath=only' syncCommand= 'cp -Rf' 1.20 +7 -3 jakarta-gump/python/gumpcore.py Index: gumpcore.py =================================================================== RCS file: /home/cvs/jakarta-gump/python/gumpcore.py,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- gumpcore.py 28 Apr 2003 02:52:27 -0000 1.19 +++ gumpcore.py 28 Apr 2003 07:30:27 -0000 1.20 @@ -13,14 +13,18 @@ of the projects in the profile. """ -import os.path, os, time, urllib, urlparse, shutil, string, os.path +import os.path, os, time, urllib, urlparse, shutil, string, os.path, logging from xml.sax import parse from xml.sax.handler import ContentHandler from gumputil import * from gumpconf import * #from Cheetah.Template import Template - +# init logging +logging.basicConfig() +log = logging.getLogger(__name__) +log.setLevel(logging.DEBUG) #set verbosity to show all messages of severity >= DEBUG + ######################################################################### # SAX Dispatcher: maintain a stack of active elements # ######################################################################### @@ -131,7 +135,7 @@ if href: newHref=gumpCache(href) - if default.debug: print 'opening: ' + newHref + '\n' + log.debug('opening: ' + newHref + '\n') element=SAXDispatcher(open(newHref),cls.__name__.lower(),cls).docElement else: name=attrs.get('name') 1.9 +9 -7 jakarta-gump/python/gumputil.py Index: gumputil.py =================================================================== RCS file: /home/cvs/jakarta-gump/python/gumputil.py,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- gumputil.py 26 Apr 2003 18:38:41 -0000 1.8 +++ gumputil.py 28 Apr 2003 07:30:27 -0000 1.9 @@ -3,11 +3,13 @@ Utility functions for Gump """ -import os, os.path, sys, urllib, urlparse +import os, os.path, sys, urllib, urlparse, logging from gumpconf import * -# output debug messages or not -debug = False #True +# init logging +logging.basicConfig() +log = logging.getLogger(__name__) +log.setLevel(logging.DEBUG) #set verbosity to show all messages of severity >= DEBUG ######################################################################### # Utility functions # @@ -25,7 +27,7 @@ if not href.startswith('http://'): newHref=gumpPath(href); else: - if debug: print 'url: ' + href + log.debug('url: ' + href) if not os.path.exists(dir.cache): os.mkdir(dir.cache) #the name of the cached descriptor @@ -35,11 +37,11 @@ #download the file if not present in the cache if os.path.exists(newHref): - if debug: print 'using cached descriptor' + log.debug('using cached descriptor') else: - if debug: print 'caching...' + log.debug('caching...') urllib.urlretrieve(href, newHref) - if debug: print '...done' + log.debug('...done') return newHref 1.12 +6 -1 jakarta-gump/python/gumpview.py Index: gumpview.py =================================================================== RCS file: /home/cvs/jakarta-gump/python/gumpview.py,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- gumpview.py 28 Apr 2003 02:52:27 -0000 1.11 +++ gumpview.py 28 Apr 2003 07:30:27 -0000 1.12 @@ -3,7 +3,7 @@ Graphic GUI to navigate a Gump workspace """ -import sys +import sys, logging from xml.sax import parse from xml.sax.handler import ContentHandler @@ -13,6 +13,11 @@ from gumpcore import load,Module,Project,buildSequence from gen import xmlize from gumpconf import * + +# init logging +logging.basicConfig() +log = logging.getLogger(__name__) +log.setLevel(logging.DEBUG) #set verbosity to show all messages of severity >= DEBUG class gumpview(wxApp): # model