def findComponents(self, event=None): d=self.askParam([{"Name":"Search String", "Type":str}]) if not d:return d=d[0] fnl=mien.dsp.modules.FUNCTIONS hits=[] for f in fnl.values(): if d in f.__name__ or (f.__doc__ and d in f.__doc__): hits.append(f) if not hits: self.report("No matches") return text="" for f in hits: text+="%s.%s\n" % (f.__module__, f.__name__) if f.__doc__: text+=blockIndent(f.__doc__, 4) text+="\n" text+="\n" self.showText(text)
def showComponents(self, event=None): funcs={} fnl=mien.dsp.modules.FUNCTIONS for fn in fnl.keys(): f=fnl[fn] if not funcs.has_key(f.__module__): funcs[f.__module__]=[] funcs[f.__module__].append(f) text="" mods=funcs.keys() mods.sort() for mn in mods: funs=funcs[mn] if funs: text+="____MODULE %s____\n" % (mn,) for fun in funs: text+=fun.__name__+"\n" if fun.__doc__: text+=blockIndent(fun.__doc__, 4) text+="\n" text+="\n" self.showText(text)