Resume multiple paused torrents.

        :param infohash_list: Single or list() of infohashes.
341337
def resume_multiple(self, infohash_list):
        
        data = self._process_infohash_list(infohash_list)
        return self._post('command/resumeAll', data=data)
1162177
def _file_list(info_list) # :nodoc:
      files = Array.new
      info_list.each {|r|
        #p r.inspect
        # file is not modified, we don't want to see it (this is 'status')
        txt_stat = r[1].text_status
        next if ' ' == status_codes(txt_stat)
        f_rec = Hash.new
        f_rec[:path] = r[0]
        f_rec[:status] = status_codes(txt_stat)
        files.push f_rec
      }
      files
    end
310014
def resume(self, mask, filename, port, pos):
        """"""
        self.connections['send']['masks'][mask][port].offset = pos
        message = 'DCC ACCEPT %s %d %d' % (filename, port, pos)
        self.bot.ctcp(mask, message)
298260
def set_torrent_upload_limit(self, infohash_list, limit):
        
        data = self._process_infohash_list(infohash_list)
        data.update({'limit': limit})
        return self._post('command/setTorrentsUpLimit', data=data)
618977
def pause(self, cause):
        
        self._pipeline.pause(name=self.data.name, cause=cause)
142147
def pause(self):
        
        if self._status == TransferState.RUNNING:
            self._running.clear()
            self._status = TransferState.PAUSED
        else:
            raise SbgError('Can not pause. Download not in RUNNING state.')
731268
def resume(localfile, jottafile, JFS):
    """"""
    with open(localfile) as lf:
        _complete = jottafile.resume(lf)
    return _complete
150990
def at_line(context, file, line)
      return if file && TRACE_IGNORE_FILES.include?(File.expand_path(file))

      # If stopped for a breakpoint or catchpoint, can't play any delayed steps
      # as they'll move away from the interruption point. (Unsure if scenario is
      # possible, but just keeping assertions in check.)
      @delayed = Hash.new(0) unless :step == context.stop_reason

      if @delayed[:next] > 1     # If any delayed nexts/steps, do 'em.
        step_over @delayed[:next] - 1
        @delayed = Hash.new(0)

      elsif @delayed[:step] > 1
        step @delayed[:step] - 1
        @delayed = Hash.new(0)

      elsif @delayed[:finish] > 0
        finish
        @delayed = Hash.new(0)

      else  # Otherwise, resume the pry session at the stopped line.
        resume_pry context
      end
    end
158564
private void resumeSearch() throws RemoteException {
        org.fcrepo.server.types.gen.FieldSearchResult searchResult =
                apia.resumeFindObjects(token);
        FieldSearchResult fsr =
                TypeUtility
                        .convertGenFieldSearchResultToFieldSearchResult(searchResult);
        for (ObjectFields fields : fsr.objectFieldsList()) {
            stash.add(fields.getPid());
        }
        token = fsr.getToken();
    }
171889
def resume_writing(self):
        ''''''
        if not self._can_send.is_set():
            self._can_send.set()
            self.transport.resume_reading()
1248169
def resume(self):
        
        with self.readSharedFileStream('config.pickle') as fileHandle:
            config = safeUnpickleFromStream(fileHandle)
            assert config.workflowID is not None
            self.__config = config
1260324
def save_loop(self):
        
        last_hash = hash(repr(self.hosts))
        while self.running:
            eventlet.sleep(self.save_interval)
            next_hash = hash(repr(self.hosts))
            if next_hash != last_hash:
                self.save()
                last_hash = next_hash
983047
def _resume(self):
        # type: (Descriptor) -> int
        
        if self._resume_mgr is None or self._offset > 0:
            return None
        # check if path exists in resume db
        rr = self._resume_mgr.get_record(self._dst_ase)
        if rr is None:
            logger.debug('no resume record for {}'.format(self._dst_ase.path))
            return None
        # ensure lengths are the same
        if rr.length != self._src_ase.size:
            logger.warning('resume length mismatch {} -> {}'.format(
                rr.length, self._src_ase.size))
            return None
        # compute replica factor
        if blobxfer.util.is_not_empty(self._dst_ase.replica_targets):
            replica_factor = 1 + len(self._dst_ase.replica_targets)
        else:
            replica_factor = 1
        # set offsets if completed
        if rr.completed:
            with self._meta_lock:
                logger.debug('{} upload already completed'.format(
                    self._dst_ase.path))
                self._offset = rr.offset
                self._src_block_list = rr.src_block_list
                self._chunk_num = rr.total_chunks
                self._chunk_size = rr.chunk_size
                self._total_chunks = rr.total_chunks
                self._completed_chunks.int = rr.completed_chunks
                self._outstanding_ops = 0
                return self._src_ase.size * replica_factor
        # re-hash from 0 to offset if needed
        _cc = bitstring.BitArray(length=rr.total_chunks)
        _cc.int = rr.completed_chunks
        curr_chunk = _cc.find('0b0')[0]
        del _cc
        # set values from resume
        with self._meta_lock:
            self._offset = rr.offset
            self._src_block_list = rr.src_block_list
            self._chunk_num = curr_chunk
            self._chunk_size = rr.chunk_size
            self._total_chunks = rr.total_chunks
            self._completed_chunks = bitstring.BitArray(length=rr.total_chunks)
            self._completed_chunks.set(True, range(0, curr_chunk + 1))
            self._outstanding_ops = (
                (rr.total_chunks - curr_chunk) * replica_factor
            )
            logger.debug(
                ('resuming file {} from byte={} chunk={} chunk_size={} '
                 'total_chunks={} outstanding_ops={}').format(
                     self._src_ase.path, self._offset, self._chunk_num,
                     self._chunk_size, self._total_chunks,
                     self._outstanding_ops))
            return rr.offset * replica_factor
1141675
def load_progress(self, resume_step):
        
        resume_step = Status[resume_step]
        progress_path = self.get_restore_path(resume_step)

        # If progress is corrupted, revert to step before
        while not self.check_for_session(resume_step):
            config.LOGGER.error("Ricecooker has not reached {0} status. Reverting to earlier step...".format(resume_step.name))
            # All files are corrupted or absent, restart process
            if resume_step.value - 1 < 0:
                self.init_session()
                return self
            resume_step = Status(resume_step.value - 1)
            progress_path = self.get_restore_path(resume_step)
        config.LOGGER.error("Starting from status {0}".format(resume_step.name))

        # Load manager
        with open(progress_path, 'rb') as handle:
            manager = pickle.load(handle)
            if isinstance(manager, RestoreManager):
                return manager
            else:
                return self
1367492
def get_torrent_download_limit(self, infohash_list):
        
        data = self._process_infohash_list(infohash_list)
        return self._post('command/getTorrentsDlLimit', data=data)
353151
def pause_resume(self):
        """"""
        if self.is_paused():
            urlopen(self.url + "&mode=resume")
        else:
            urlopen(self.url + "&mode=pause")
484726
def getPeersFromTracker(torrentData, infoHash)
      addPeer = Proc.new do |trackerPeer|
        peer = Peer.new(trackerPeer)
        peer.infoHash = infoHash
        torrentData.peers.add peer
        true
      end

      classifiedPeers = nil
      replaceDisconnectedPeer = Proc.new do |trackerPeer|
        classifiedPeers = ClassifiedPeers.new(torrentData.peers.all) if ! classifiedPeers
  
        if classifiedPeers.disconnectedPeers.size > 0
          torrentData.peers.delete classifiedPeers.disconnectedPeers.pop
          addPeer.call trackerPeer
          true
        else
          false
        end
      end

      trackerclient = torrentData.trackerClient 
    
      addProc = addPeer
      flipped = false
      trackerclient.peers.each do |p|
        if ! flipped && torrentData.peers.size >= @maxPeerCount
          addProc = replaceDisconnectedPeer
          flipped = true
        end
      
        # Don't treat ourself as a peer.
        next if p.id && p.id == trackerclient.peerId
            
        if ! torrentData.peers.findByAddr(p.ip, p.port)
          @logger.debug "#{QuartzTorrent.bytesToHex(torrentData.infoHash)}: Adding tracker peer #{p} to peers list"
          break if ! addProc.call(p)
        end
      end
    end