Text archives Help
- From:
- To:
- Subject: [Manta] r2366 - trunk/scenes/csafe/python
- Date: Thu, 8 Jan 2009 15:34:06 -0700 (MST)
Author: dav
Date: Thu Jan 8 15:34:04 2009
New Revision: 2366
Modified:
trunk/scenes/csafe/python/csafe_scene.py
Log:
added 'res' to usage. exit from usage() to minimize code. Make usage()
output a little better.
Modified: trunk/scenes/csafe/python/csafe_scene.py
==============================================================================
--- trunk/scenes/csafe/python/csafe_scene.py (original)
+++ trunk/scenes/csafe/python/csafe_scene.py Thu Jan 8 15:34:04 2009
@@ -689,74 +689,43 @@
print ""
print "Where options contains one or more of:"
print ""
+ print " --res=WxH : resolution of render window"
print " --np=<int> : the number of threads to use"
print " --cfg=<string> : load a configuration file"
print " --nrrdlist=<string> : load a nrrdlist"
print " --g : automatically/immediately generate scene
when starting up"
print ""
+ sys.exit( 2 )
def main():
global setup
# Parse command line options. Note these have to conform to getopt
# So -np would be parsed as -n <space> p. Use --np=<threads> instead.
-# print sys.argv
-
- # Add additional command line args here.
-# try:
-# args = wxManta.parseCommandLine(sys.argv)
-# for i in range(len(args)):
-# print args[i]
-# if (args[i][0] == "np"):
-# setup.num_workers = int(float(args[i][1][0]))
-# print "setting np to: " + str(setup.num_workers)
-# elif (args[i][0] == "cfg"):
-# setup.cfg = args[i][1][0]
-# print "loading configuraiton file: " + str(setup.cfg)
-# elif (args[i][0] == "nrrdlist"):
-# setup.nrrdlist = args[i][1][0]
-# print "loading nrrdlist: " + str(setup.nrrdlist)
-# elif (args[i][0] == "uda"):
-# setup.uda = args[i][1][0]
-# print "loading uda: " + str(setup.uda)
-# i += 1
-# setup.udaVol = args[i][1][0]
-# elif (args[i][0] == "g"):
-# setup.generate = True
-# print "generating scene on startup"
-# else:
-# print "unable to understand command: " + str(args[i])
-# usage()
-# except :
-# print "Inorrect commandline usage"
-# usage()
- # Parse command line options. Note these have to conform to getopt
- # So -np would be parsed as -n <space> p. Use --np=<threads> instead.
try:
opts, args = getopt.getopt(sys.argv[1:],
"n:s:r:",
- ["np=",
- "scene=",
- "imagetype=",
- "shadows=",
+ ["cfg=",
+ "g",
+ "help",
"imagetraverser=",
+ "imagetype=",
"loadbalancer=",
+ "np=",
+ "nrrdlist=",
"pixelsampler=",
"renderer=",
"res=",
- "cfg=",
- "nrrdlist=",
- "g"
+ "scene=",
+ "shadows="
] )
except getopt.GetoptError, error:
usage( [error.msg] )
- sys.exit(2)
if len( args ) > 0 :
usage( args )
- sys.exit(2)
for o, a in opts:
@@ -767,8 +736,7 @@
try:
setup.num_workers = int(a)
except ValueError:
- usage()
- sys.exit(2)
+ usage( [a] )
elif o in ("--imagetype"):
setup.imagetype = str(a)
@@ -796,12 +764,9 @@
if (m):
setup.size = (int(m.group(1)), int(m.group(2)))
else:
- print "Bad resolution string"
- usage()
- sys.exit(2)
+ usage( ["Bad resolution string:", a] )
elif o in ("-h", "--help"):
usage();
- sys.exit(0)
# Add additional command line args here.
elif o in ("--cfg"):
@@ -814,8 +779,7 @@
elif o in ("--g"):
setup.generate = True
else:
- print "unable to understand command: " + str(o)
- usage()
+ usage( [o] )
###########################################################################
# Create the application.
- [Manta] r2366 - trunk/scenes/csafe/python, dav, 01/08/2009
Archive powered by MHonArc 2.6.16.