Example #1
0
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
Example #2
0
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)
Example #3
0
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)
Example #4
0
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
Example #5
0
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
Example #6
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