strs=[] for line in open(source).read().splitlines(): if not '#' in line: if otypes in line: strs.append(line) strsf=open(listh+".txt",'w') strsf.write(config.words(thing).get('word02')) strsf.write(nonselectstate+nss.join(strs)+'\n') strsf.close() ## ---------------------------------------------- def clean(listh): status=os.system("rm "+listh+"*") ## ---------------------------------------------- ## Order ## ---------------------------------------------- if config.argv('gensl.py','dtm') == 'true': if "--playlist" in sys.argv: otypes="aac.flac.ogg.m4a.mp3.wav.wma" source=musicdir listh=forpledit thing='songs' clean(listh) gensl(otypes,source,listh,thing) mode(listh,1) genm3u(source,listh) elif "--reclist" in sys.argv: otypes="wav" source=recorddir listh=forrecdit thing='records' clean(listh)
sets.append(line) status=os.system("rm "+temp) return sets ## ---------------------------------------------- def convlist(plist): sets=[] for line in open(plist).read().splitlines(): if '#' not in line: if nonselectstate not in line: sets.append(line) return sets ## ---------------------------------------------- ## Order ## ---------------------------------------------- ##if config.dtmargv('gensl.py') == 'true': if config.argv('debug','boolean') == 'true': print 'debug mode on' dbmd='on' if "--playall" in sys.argv: ouput(process(gensl.gen4p(),11,musicdir),musicdir) elif "--playrand" in sys.argv: ouput(process(gensl.gen4p(),13,musicdir),musicdir) elif "--playlist" in sys.argv: source=musicdir listh=forpledit ouput(process(genlist(source,listh),ascertain(listh),source),source) elif '--help' in sys.argv: print "genpl.py: Playlist Generator" print "Usage: " print " python genpl.py { --playall | --playrand | --playlist | --reclist | --strlist | --help }"