Example #1
0
async def upload():

    print("Proceso upload inicializado")

    with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
        s.bind(("127.0.0.1", 8000))
        s.listen(0)
        while True:
            conn, addr = s.accept()
            client = Upload(conn, addr, torrent)
            client.start()
Example #2
0
def main():

    imgStoreQueue = Queue.Queue()
    smsQueue = Queue.Queue()

    logging.info ('Initializing Camera Module...')

    myCam = Camera('Camera', imgStoreQueue, smsQueue)
    myCam.setSaveLocation('/home/pi')

    logging.info ('Initializing Upload Module...')

    myUpload = Upload('Upload', imgStoreQueue, smsQueue)

    logging.info ('Initializing SMS Module...')

    logging.info ('App started. Press \'exit\' to quit program.')

    myCam.start()
    myUpload.start()

    try:
        while True:
            strInput = raw_input()
            if strInput == 'exit':
                if myCam.isAlive():
                    myCam.join()
                if myUpload.isAlive():
                    myUpload.join()
                break
    except KeyboardInterrupt as e:
        logging.info("Stopping...")
        if myCam.isAlive():
            myCam.join()
        if myUpload.isAlive():
            myUpload.join()