示例#1
0
def next(params, d, doneflag):
    try:
        p = join(split(argv[0])[0], 'donated')
        if not exists(p) and long(time()) % 3 == 0:
            open_new('http://bitconjurer.org/BitTorrent/donate.html')
            dlg = wxMessageDialog(d.frame, 'BitTorrent is Donation supported software. ' + 
                'Please go to the donation page (which should be appearing for you now) and make a donation from there. ' + 
                'Or you can click no and donate later.\n\nHave you made a donation yet?',
                'Donate!', wxYES_NO | wxICON_INFORMATION | wxNO_DEFAULT)
            if dlg.ShowModal() == wxID_YES:
                dlg.Destroy()
                dlg = wxMessageDialog(d.frame, 'Thanks for your donation! You will no longer be shown donation requests.\n\n' + 
                    "If you haven't actually made a donation and are feeling guilty (as you should!) you can always get to " + 
                    "the donation page by clicking the 'about' link in the upper-right corner of the main BitTorrent window and " + 
                    'donating from there.', 'Thanks!', wxOK)
                dlg.ShowModal()
                dlg.Destroy()
                try:
                    open(p, 'wb').close()
                except IOError, e:
                    dlg = wxMessageDialog(d.frame, "Sorry, but I couldn't set the flag to not ask you for donations in the future - " + str(e),
                        'Sorry!', wxOK | wxICON_ERROR)
                    dlg.ShowModal()
                    dlg.Destroy()
            else:
                dlg.Destroy()
        download(params, d.chooseFile, d.updateStatus, d.finished, d.error, doneflag, 100, d.newpath)
        if not d.fin:
            d.failed()
def run(mainerrlist, params):
    d = CursesDisplayer(mainerrlist)
    try:
        download(params, d.chooseFile, d.display, d.finished, d.error, mainkillflag, fieldw)
    except KeyboardInterrupt:
        # ^C to exit.. 
        pass 
    if not d.done:
        d.failed()
def run(params):
    try:
        import curses
        curses.initscr()
        cols = curses.COLS
        curses.endwin()
    except:
        cols = 80

    h = HeadlessDisplayer()
    download(params, h.chooseFile, h.display, h.finished, h.error, Event(), cols, h.newpath)
    if not h.done:
        h.failed()
 def download(self): 
     download(self.params + ['--responsefile', self.file], self.choose, self.display, self.finished, self.err, self.myinfo['kill'], 80)
     status = 'Torrent %s stopped' % self.file
示例#5
0
 def download(self): 
     download(self.params + ['--responsefile', self.file], self.choose, self.display, self.finished, self.err, self.myinfo['kill'], 80)
     print 'Torrent %s stopped' % self.file
     stdout.flush()