# Search through ./channels/ and get module basenames.# Also order them by conf.channel_order#def module_list():# Should list plugins within zips as well as local paths ls = pkgutil.iter_modules(["channels"]) ls = pkgutil.iter_modules([conf.share+"/channels","channels"]) ls =[name for loader,name,ispkg in ls]print ls# resort with tab order
order =[module.strip()formodulein conf.channel_order.lower().replace(".","_").replace("-","_").split(",")]
ls =[moduleformodulein(order)if(modulein ls)]+[moduleformodulein(ls)if(modulenotin order)]return ls