Esempio n. 1
0
def wcreate(seed):
    seed = seed*seed
    seed = seed*seed
    seed = seed*seed
    seedlist = resources.splitdig(seed)
    wcount = 1
    try:
        for i in seedlist[:]:
            if i == 0:
                seedlist.remove(i)
        while not len(output) == 9:
            if seedlist[wcount - 1]%2 == 0:
                if not check(seedlist[-wcount]) == "T":
                    output.append(seedlist[-wcount])
                else:
                    pass
            else:
                if not check(seedlist[-wcount + 1]) == "T":
                    output.append(seedlist[-wcount + 1])
                else:
                     pass
            wcount = wcount + 1
    except IndexError:
        print "Please Enter another seed, your last one was broken"
        customseed()
    return output[:]
def choosedb():
    global titles
    global files
    titles = []
    files = []
    c = 1
    lastlinefile = True
    lastlinetitle = False
    infile = open("Config.txt", "r")
    for line in infile:
        line = line.strip()
        if not line[0] == "-":
            if line[0] == "#":
                if lastlinefile == False:
                    print "Your Config File has either an extra title or is missing a path."
                    lastlinetitle = False
                    lastlinefile = True
                elif lastlinefile == True:
                    titles.append(line.strip("#"))
                    lastlinetitle = True
                    lastlinefile = False
            else:
                if lastlinetitle == True:
                    files.append(line.strip("\n"))
                    lastlinetitle = False
                    lastlinefile = True
                elif lastlinetitle == False:
                    titles.append("Untitled Database")
                    files.append(line.strip())
                    lastlinefile = True
    itemnum = 1
    for item in titles:
        print str(itemnum) + ". " + item + " - " + str(files[itemnum - 1])
        itemnum = itemnum + 1
    print ""
    print "Choose a database. To choose multiple databases type all of it's numbers"
    print "with no space (e.g. 13 to choose databases 1 and 3)."
    print "Type 0 to load all Databases"
    choice = input("Enter The Number(s) of your chosen Database: ")
    print "-+" * 20
    runc = 1
    choicelist = []
    if choice == 0:
        while not runc > len(files):
            choicelist.append(runc)
            runc = runc + 1
    else:
        choicelist = list(resources.splitdig(choice))
    getdb(choicelist)