Beispiel #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
Beispiel #2
0
def enterDb(entry):

    #console
    consoleClass.thread2 = entry + " received"
    
    dateInfo = datetime.utcnow()
    dbEntry = Sub.create(
                        userName = entry,
                        entryTime = dateInfo
                    )
    dbEntry.save()
Beispiel #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
Beispiel #4
0
def enterDb(entry):
    print("pubSub: entering " + entry)

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