def readOptlist(self, optlist):
for o, a in optlist:
o = o[2:] # strip the leading --
if o in configOptions:
val = getattr(self, o)
# check to see if the current/default value is a boolean. If so,
# then the value is true if specified as a flag; otherwise, convert
# the option value to a bool.
if val.__class__ == bool:
if (a == None or len(a) == 0) :
val = True
else:
val = (a.strip().lower() == "true")
else:
val = a
setattr(self, o, val)
# ---------------------
# usage text for help
# ---------------------
评论列表
文章目录