def _getOptions(classtype):
try:
# IMPORTANT YOU CANNOT USE gnu_getopt OR OptionParser
# because they will treat execparams with negative number
# values as arguments.
#
# Since property ids *MUST* be valid XML names
# they cannot start with -, therefore this is safe
opts, args = getopt.getopt(sys.argv[1:], "i", ["interactive"])
if len(opts)==0 and len(args)==0:
print "usage: %s [options] [execparams]" % sys.argv[0]
print
print "The set of execparams is defined in the .prf for the component"
print "They are provided as arguments pairs ID VALUE, for example:"
print " %s INT_PARAM 5 STR_PARAM ABCDED" % sys.argv[0]
print
print classtype.__doc__
sys.exit(2)
except getopt.GetoptError:
print "usage: %s [options] [execparams]" % sys.argv[0]
print
print "The set of execparams is defined in the .prf for the component"
print "They are provided as arguments pairs ID VALUE, for example:"
print " %s INT_PARAM 5 STR_PARAM ABCDED" % sys.argv[0]
print
print classtype.__doc__
sys.exit(2)
return opts, args
评论列表
文章目录