Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(1)  |  Call(0)  |  Derive(0)  |  Import(1)

src/k/a/kamaelia-HEAD/Sketches/RJL/bittorrent/BitTorrent/bittorrent.py   kamaelia(Download)
 
from BitTorrent.parseargs import makeHelp
from BitTorrent.TorrentQueue import RUNNING, RUN_QUEUED, QUEUED, KNOWN, ASKING_LOCATION
from BitTorrent.TrayIcon import TrayIcon
from BitTorrent.StatusLight import GtkStatusLight as StatusLight
        if self.torrent_state == KNOWN:
            menu_items.append( MenuItem(_("Re_start"), func=self.move_to_end   ))
        elif self.torrent_state == QUEUED:
            #Here's where we'll put the "Start hash check" menu item
            menu_items.append(MenuItem(_("Download _now"), func=self.start))            
    def move_to_end(self, widget):
        self.main.change_torrent_state(self.infohash, QUEUED)
 
 
class DroppableTorrentBox(TorrentBox):
class QueuedTorrentBox(DroppableTorrentBox):
    icon_name = 'bt-queued'
    torrent_state = QUEUED
 
    def __init__(self, infohash, metainfo, dlpath, completion, main):
    def move_to_end(self, widget):
        self.main.change_torrent_state(self.infohash, QUEUED)
 
    def finish(self, widget):
        self.main.change_torrent_state(self.infohash, KNOWN)