[Python-checkins] python/dist/src/Mac/scripts bgenall.py,1.3,1.4

jackjansen@users.sourceforge.net jackjansen@users.sourceforge.net
Mon, 05 Aug 2002 14:14:19 -0700


Update of /cvsroot/python/python/dist/src/Mac/scripts
In directory usw-pr-cvs1:/tmp/cvs-serv22390

Modified Files:
	bgenall.py 
Log Message:
Better output for errors, and some progress reports.
Handle the two modules with non-standard scanner module names.


Index: bgenall.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/scripts/bgenall.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** bgenall.py	5 Aug 2002 15:33:44 -0000	1.3
--- bgenall.py	5 Aug 2002 21:14:16 -0000	1.4
***************
*** 7,17 ****
  def bgenone(dirname, shortname):
  	os.chdir(dirname)
  	try:
! 		m = __import__(shortname+'scan')
  	except:
  		return 0
  	try:
  		m.main()
  	except:
  		return 0
  	return 1
--- 7,28 ----
  def bgenone(dirname, shortname):
  	os.chdir(dirname)
+ 	print '%s:'%shortname
+ 	# Sigh, we don't want to lose CVS history, so two
+ 	# modules have funny names:
+ 	if shortname == 'carbonevt':
+ 		modulename = 'CarbonEvtscan'
+ 	elif shortname == 'ibcarbon':
+ 		modulename = 'IBCarbonscan'
+ 	else:
+ 		modulename = shortname + 'scan'
  	try:
! 		m = __import__(modulename)
  	except:
+ 		print "Error:", shortname, sys.exc_info()[1]
  		return 0
  	try:
  		m.main()
  	except:
+ 		print "Error:", shortname, sys.exc_info()[1]
  		return 0
  	return 1