# Written by Bram Cohen
# see LICENSE.txt for license information

import BitTorrent.download
from threading import Event

def dummychoose(default, size, saveas, dir):
    return saveas

def dummydisplay(dict):
    print dict

def dummyerror(message):
    print message

def download(url, file):
    ev = Event()
    def fin(ev = ev):
        ev.set()
    BitTorrent.download.download(['--url', url, '--saveas', file], 
        dummychoose, dummydisplay, fin, dummyerror, ev, 80)

def downloadSeeder(url, file, ev):
    def fin():
        pass
    BitTorrent.download.download(['--url', url, '--saveas', file], 
        dummychoose, dummydisplay, fin, dummyerror, ev, 80)
    
