def loadFromUtaiteInfo(utaiteList = []): #{ try: f = open("UtaiteInfo.out", 'r') curr = Utaite() currUtaiteNum = 0 currSongCount = 0; currDlCount = 0; utaiteNum = f.readline(); while currUtaiteNum < int(utaiteNum): curr.name = f.readline(); curr.songCount = int(f.readline()) curr.dlCount = int(f.readline()) while (currSongCount < curr.songCount): curr.songList.append(f.readline()) currSongCount=currSongCount+1 while (currDlCount < curr.dlCount): curr.dlList.append(f.readline()) currDlCount=currDlCount+1 utaiteList.append(curr) curr = Utaite() currUtaiteNum = currUtaiteNum + 1 currSongCount = 0 currDlCount = 0 except IOError: print "IOError; no UtaiteInfo.out found. Please load a backup." pass
def addToUtaiteInfo(filename, utaiteList=[]): #{ s = "./sedtest2.sh " + filename + " out" subprocess.call(s, shell=True) file = open("out", 'r') curr = Utaite() curr.songCount = 0 curr.name = file.readline() for line in file: curr.songList.append(line) curr.songCount = curr.songCount + 1 utaiteList.append(curr)
def loadFromUtaiteInfo(utaiteList=[]): #{ try: f = open("UtaiteInfo.out", 'r') curr = Utaite() currUtaiteNum = 0 currSongCount = 0 currDlCount = 0 utaiteNum = f.readline() while currUtaiteNum < int(utaiteNum): curr.name = f.readline() curr.songCount = int(f.readline()) curr.dlCount = int(f.readline()) while (currSongCount < curr.songCount): curr.songList.append(f.readline()) currSongCount = currSongCount + 1 while (currDlCount < curr.dlCount): curr.dlList.append(f.readline()) currDlCount = currDlCount + 1 utaiteList.append(curr) curr = Utaite() currUtaiteNum = currUtaiteNum + 1 currSongCount = 0 currDlCount = 0 except IOError: print "IOError; no UtaiteInfo.out found. Please load a backup." pass
def loadFromSpecificUtaiteInfo(filename, utaiteList = []): #{ f = open(filename, 'r') curr = Utaite() currUtaiteNum = 0 currSongCount = 0; currDlCount = 0; utaiteNum = f.readline(); while currUtaiteNum < int(utaiteNum): curr.name = f.readline(); curr.songCount = int(f.readline()) curr.dlCount = int(f.readline()) while (currSongCount < curr.songCount): curr.songList.append(f.readline()) currSongCount=currSongCount+1 while (currDlCount < curr.dlCount): curr.dlList.append(f.readline()) currDlCount=currDlCount+1 utaiteList.append(curr) curr = Utaite() currUtaiteNum = currUtaiteNum + 1 currSongCount = 0 currDlCount = 0
def loadFromUtaiteInfo(utaiteList=[]): #{ f = open("UtaiteInfo.out", 'r') curr = Utaite() currUtaiteNum = 0 currSongCount = 0 currDlCount = 0 utaiteNum = f.readline() while currUtaiteNum < int(utaiteNum): curr.name = f.readline() curr.songCount = int(f.readline()) curr.dlCount = int(f.readline()) while (currSongCount < curr.songCount): curr.songList.append(f.readline()) currSongCount = currSongCount + 1 while (currDlCount < curr.dlCount): curr.dlList.append(f.readline()) currDlCount = currDlCount + 1 utaiteList.append(curr) curr = Utaite() currUtaiteNum = currUtaiteNum + 1 currSongCount = 0 currDlCount = 0