curDocStrings = []
elif op == 'cat ':
- if string.strip(line[4:]) == 'Deprecated':
+ if line[4:].strip() == 'Deprecated':
break # skip the rest of the file
elif op == 'evt ':
pass
else:
- print '***** Unknown line type: ', line
+ print('***** Unknown line type: %s' % line)
# process templates
def joinWithNewLines(values):
- return string.join(values, '\n')
+ return '\n'.join(values)
#----------------------------------------------------------------------------
def checkMethodOverride(name, number, docs):
theDef = theImp = None
- if methodOverrideMap.has_key(name):
+ if name in methodOverrideMap:
item = methodOverrideMap[name]
try:
if item[3] != 0:
docs = item[3]
except:
- print "*************", name
+ print("************* " + name)
raise
return name, theDef, theImp, docs
#----------------------------------------------------------------------------
def parseVal(line, values, docs):
- name, val = string.split(line, '=')
+ name, val = line.split('=')
# remove prefixes such as SCI, etc.
for old, new in valPrefixes:
def parseFun(line, methods, docs, values, is_const):
def parseParam(param):
- param = string.strip(param)
+ param = param.strip()
if param == '':
param = None
else:
- param = tuple(string.split(param))
+ param = tuple(param.split())
return param
mo = funregex.match(line)
if mo is None:
- print "***** Line doesn't match! : " + line
+ print("***** Line doesn't match! : %s" % line)
retType, name, number, param1, param2 = mo.groups()
param2 = parseParam(param2)
# Special case. For the key command functions we want a value defined too
- num = string.atoi(number)
+ num = int(number)
for v in cmdValues:
if (type(v) == type(()) and v[0] <= num <= v[1]) or v == num:
- parseVal('CMD_%s=%s' % (string.upper(name), number), values, docs)
+ parseVal('CMD_%s=%s' % (name.upper(), number), values, docs)
# if we are not also doing a function for CMD values, then
# just return, otherwise fall through to the append blow.
# TODO: parse command line args to replace default input/output files???
if not os.path.exists(IFACE):
- print 'Please run this script from src/stc subdirectory.'
+ print('Please run this script from src/stc subdirectory.')
sys.exit(1)
# Now just do it