def generateArgList(arglist):
 args = []
 extra = []
 count = 0
 for i in range(len(arglist)):
  elt = arglist[i]
  if isinstance(elt, str):
   args.append(elt)
  elif isinstance(elt, tuple):
   args.append(TupleArg((i * 2), elt))
   extra.extend(misc.flatten(elt))
   count = (count + 1)
  else:
   raise ValueError, 'unexpect argument type:', elt
 return ((args + extra), count)

def generateArgList ( arglist ) : args = [ ] extra = [ ] count = 0 for i in range ( len ( arglist ) ) : elt = arglist [ i ] if isinstance ( elt , str ) : args . append ( elt ) elif isinstance ( elt , tuple ) : args . append ( TupleArg ( ( i * 2 ) , elt ) ) extra . extend ( misc . flatten ( elt ) ) count = ( count + 1 ) else : raise ValueError , 'unexpect argument type:' , elt return ( ( args + extra ) , count )
generate an arg list marking tupleargs .