def _print_sym_list(agent, title, list): print title for sym in list: reqArgs = requiredargnames(agent, sym) if reqArgs is not None: args = ' '.join([("$" + str(x)) for x in reqArgs]) else: args = '' restargs = restargnames(agent, sym) if restargs is not None: args = args + ' rest: ' + " ".join([str(x) for x in restargs]) print " ", sym.name, args
def _print_sym_list(agent, title, list): print title for sym in list: reqArgs = requiredargnames(agent, sym) if reqArgs is not None: args = " ".join([("$" + str(x)) for x in reqArgs]) else: args = "" restargs = restargnames(agent, sym) if restargs is not None: args = args + " rest: " + " ".join([str(x) for x in restargs]) print " ", sym.name, args
def doc_symbol(mod, usage, f): """generates documentation for the specified symbol. this is a subroutine of doc_module""" f.write('<div class="entry">') f.write('<dl>') modname = mod.get_modpath().name global all_symbols decls = [d for d in getPackageDecls(testagent, mod.filename)] decls.sort(decl_cmp) for decl in decls: sym = decl.asSymbol() if sym.modname == modname and decl.optMode(usage): all_symbols.append(sym) args = ' <span class="args">' required = requiredargnames(testagent, sym) if required: args = args + '$' + ' $'.join(required) restargs = restargnames(testagent, sym) if restargs: args = args + ' <em>rest: ' + ' '.join(restargs) + '</em>' args = args + "</span>" f.write('<dt><a name="' + anchorName(sym.id) + '"></a><b>' + sym.id + '</b>' + args + '</dt>') f.write('<dd>') doc = get_fact(testagent, P_Doc, sym) if doc: f.write(doc + '<br />') features = get_fact(testagent, P_Features, sym) if features: f.write('<b>Features:</b> ' + htmlStr(features) + '<br />') properties = get_fact(testagent, P_Properties, sym) if properties: f.write('<b>Properties:</b> ' + htmlStr(properties) + '<br />') f.write('</dd>') f.write('</dl>') f.write('</div>')
def doc_symbol(mod, usage, f): """generates documentation for the specified symbol. this is a subroutine of doc_module""" f.write('<div class="entry">') f.write('<dl>') modname = mod.get_modpath().name global all_symbols decls = [d for d in getPackageDecls(testagent, mod.filename)] decls.sort(decl_cmp) for decl in decls: sym = decl.asSymbol() if sym.modname == modname and decl.optMode(usage): all_symbols.append(sym) args = ' <span class="args">' required = requiredargnames(testagent, sym) if required: args = args + '$' + ' $'.join(required) restargs = restargnames(testagent, sym) if restargs: args = args+' <em>rest: '+ ' '.join(restargs)+'</em>' args = args + "</span>" f.write('<dt><a name="'+anchorName(sym.id)+'"></a><b>'+sym.id+'</b>'+args+'</dt>') f.write('<dd>') doc = get_fact(testagent, P_Doc, sym) if doc: f.write(doc+'<br />') features = get_fact(testagent, P_Features, sym) if features: f.write('<b>Features:</b> '+htmlStr(features)+'<br />') properties = get_fact(testagent, P_Properties, sym) if properties: f.write('<b>Properties:</b> '+htmlStr(properties)+'<br />') f.write('</dd>') f.write('</dl>') f.write('</div>')