Ejemplo n.º 1
0
def makeDb():
    fileName = open("subscriberListTest.txt")
    count = 0

    for entry in fileName:

        entry = entry.strip()

        #fast
        dateTime = datetime.utcnow() + timedelta(seconds=count)

        count += 1
        dbEntry = Sub.create(userName=entry, entryTime=dateTime)
        dbEntry.save()

        consoleClass.thread2 = str(count) + " entered to db"

        #slow
        #consoleClass.thread4 = "added " + entry
        #time.sleep(random.randint(10,100)) #up to 10 seconds for testing
        #time.sleep(0.2)

    consoleClass.thread2 = str(count) + " entered to db, done you f**k"
    fileName.close()
    return count
Ejemplo n.º 2
0
def enterDb(entry):

    #console
    consoleClass.thread2 = entry + " received"
    
    dateInfo = datetime.utcnow()
    dbEntry = Sub.create(
                        userName = entry,
                        entryTime = dateInfo
                    )
    dbEntry.save()
Ejemplo n.º 3
0
def makeDb():
    fileName = open("subscriberListTest.txt")
    count = 0

    for entry in fileName:
        entry = entry.strip()
        dateTime = datetime.utcnow()
        count += 1
        dbEntry = Sub.create(userName=entry, entryTime=dateTime)
        dbEntry.save()
        print("dbmaker: " + entry)
        #time.sleep(random.randint(10,100)) #up to 10 seconds for testing

    print("dbMaker: done, you f**k.")
    fileName.close()
    return count
Ejemplo n.º 4
0
def enterDb(entry):
    print("pubSub: entering " + entry)

    dateInfo = datetime.utcnow()
    dbEntry = Sub.create(userName=entry, entryTime=dateInfo)
    dbEntry.save()