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

All Samples(191)  |  Call(156)  |  Derive(0)  |  Import(35)

            def clock():
        return _RTIME.get_time()
        


src/f/r/FriendlyTorrent-HEAD/src/tornado/BitTornado/BT1/Downloader.py   FriendlyTorrent(Download)
from BitTornado.bitfield import Bitfield
from random import shuffle
from BitTornado.clock import clock
try:
    True
            if self.interested:
                self._request_more(new_unchoke = True)
            self.last2 = clock()
 
    def is_choked(self):
            self.connection.send_interested()
            if not self.choked:
                self.last2 = clock()
 
    def send_not_interested(self):
        if self.downloader.endgamemode:
            self.downloader.all_requests.remove((index, begin, length))
        self.last = clock()
        self.last2 = clock()
        self.measure.update_rate(length)

src/b/i/BitTornado-HEAD/btdownloadgui.py   BitTornado(Download)
from BitTornado.bencode import bencode
from BitTornado.natpunch import UPnP_test
from BitTornado.clock import clock
from BitTornado import version, createPeerID, report_email
 
            self.scrollock = 0
            self.lastError = 0
            self.spewwait = clock()
            self.config = None
            self.updateSpinnerFlag = 0
                os.path.join(self.basepath, 'alloc.gif'), wx.wxBITMAP_TYPE_GIF)
 
            self.starttime = clock()
 
            self.frame = frame
            def reannounce(self, frame=self):
                if (clock() - frame.reannouncelast > 60):
                    frame.reannouncelast = clock()
                    frame.dow.reannounce()
            wx.EVT_BUTTON(self.advBox, reannounceButton.GetId(), reannounce)

src/b/i/BitTornado-HEAD/BitTornado/BT1/Downloader.py   BitTornado(Download)
import random
from BitTornado.CurrentRateMeasure import Measure
from BitTornado.bitfield import Bitfield
from BitTornado.clock import clock
 
            if self.interested:
                self._request_more(new_unchoke=True)
            self.last2 = clock()
 
    def is_choked(self):
            self.connection.send_interested()
            if not self.choked:
                self.last2 = clock()
 
    def send_not_interested(self):
        if self.downloader.endgamemode:
            self.downloader.all_requests.remove((index, begin, length))
        self.last = clock()
        self.last2 = clock()
        self.measure.update_rate(length)

src/h/e/Herd-HEAD/BitTornado/BT1/Downloader.py   Herd(Download)
from BitTornado.bitfield import Bitfield
from random import shuffle
from BitTornado.clock import clock
try:
    True
            if self.interested:
                self._request_more(new_unchoke = True)
            self.last2 = clock()
 
    def is_choked(self):
            self.connection.send_interested()
            if not self.choked:
                self.last2 = clock()
 
    def send_not_interested(self):
        if self.downloader.endgamemode:
            self.downloader.all_requests.remove((index, begin, length))
        self.last = clock()
        self.last2 = clock()
        self.measure.update_rate(length)

src/s/w/swarm-HEAD/BitTornado/BT1/Downloader.py   swarm(Download)
from BitTornado.bitfield import Bitfield
from random import shuffle
from BitTornado.clock import clock
try:
    True
            if self.interested:
                self._request_more(new_unchoke = True)
            self.last2 = clock()
 
    def is_choked(self):
            self.connection.send_interested()
            if not self.choked:
                self.last2 = clock()
 
    def send_not_interested(self):
        if self.downloader.endgamemode:
            self.downloader.all_requests.remove((index, begin, length))
        self.last = clock()
        self.last2 = clock()
        self.measure.update_rate(length)

src/o/w/OwnTube-HEAD/videoportal/BitTornadoABC/BitTornado/BT1/Downloader.py   OwnTube(Download)
from BitTornado.bitfield import Bitfield
from random import shuffle
from BitTornado.clock import clock
try:
    True
            if self.interested:
                self._request_more(new_unchoke = True)
            self.last2 = clock()
 
    def is_choked(self):
        if self.downloader.endgamemode:
            self.downloader.all_requests.remove((index, begin, length))
        self.last = clock()
        self.last2 = clock()
        self.measure.update_rate(length)
    def is_snubbed(self):
        if not self.choked and clock() - self.last2 > self.downloader.snub_time:
            for index, begin, length in self.active_requests:
                self.connection.send_cancel(index, begin, length)
            self.got_choke()    # treat it just like a choke

src/o/w/OwnTube-HEAD/videoportal/BitTornadoABC/BitTornado/BT1/StorageWrapper.py   OwnTube(Download)
from BitTornado.bitfield import Bitfield
from sha import sha
from BitTornado.clock import clock
from traceback import print_exc
from random import randrange
            if init():
                self.statusfunc(activity = msg, fractionDone = done)
                t = clock() + STATS_INTERVAL
                x = 0
                while x is not None:
                    if t < clock():
                        t = clock() + STATS_INTERVAL

src/f/r/FriendlyTorrent-HEAD/src/tornado/BitTornado/BT1/StorageWrapper.py   FriendlyTorrent(Download)
from BitTornado.bitfield import Bitfield
from hashlib import sha1
from BitTornado.clock import clock
from traceback import print_exc
from random import randrange
            if init():
                self.statusfunc(activity = msg, fractionDone = done)
                t = clock() + STATS_INTERVAL
                x = 0
                while x is not None:
                    if t < clock():
                        t = clock() + STATS_INTERVAL

src/o/w/OwnTube-HEAD/videoportal/BitTornadoABC/BitTornado/BT1/track.py   OwnTube(Download)
from traceback import print_exc
from time import time, gmtime, strftime, localtime
from BitTornado.clock import clock
from random import shuffle, seed
from types import StringType, IntType, LongType, DictType
        self.show_names = config['show_names']
        rawserver.add_task(self.save_state, self.save_dfile_interval)
        self.prevtime = clock()
        self.timeout_downloaders_interval = config['timeout_downloaders_interval']
        rawserver.add_task(self.expire_downloaders, self.timeout_downloaders_interval)
 
        elif not peer:
            ts[myid] = clock()
            peer = {'ip': ip, 'port': port, 'left': left}
            if mykey:
                return rsize    # return w/o changing stats
 
            ts[myid] = clock()
            if not left and peer['left']:
                self.completed[infohash] += 1
            cache = self.cached_t.setdefault(infohash, None)
            if ( not cache or len(cache[1]) < rsize
                 or cache[0] + self.config['min_time_between_cache_refreshes'] < clock() ):
                bc = self.becache.setdefault(infohash,[[{}, {}], [{}, {}], [{}, {}]])
                cache = [ clock(), bc[0][0].values() + bc[0][1].values() ]

src/b/i/BitTornado-HEAD/BitTornado/BT1/StorageWrapper.py   BitTornado(Download)
import hashlib
from BitTornado.bitfield import Bitfield
from BitTornado.clock import clock
from random import randrange
try:
            if init():
                self.statusfunc(activity=msg, fractionDone=done)
                t = clock() + STATS_INTERVAL
                x = 0
                while x is not None:
                    if t < clock():
                        t = clock() + STATS_INTERVAL

  1 | 2 | 3 | 4  Next