Sha256: e482ec4a3725cbf142226fc2a47a558e921ae33e0aa7c2c73aa1b7aa258b3ac4
Contents?: true
Size: 1.41 KB
Versions: 1
Compression:
Stored size: 1.41 KB
Contents
def runtorrentwindow $torrenttodownload = TorrentRootDir + $rwdtorrentfilesdir + "/" + @a_viewtorrent + ".torrent" rwdtorrentwindowtwo end def runtorrentwindowhttp $torrenttodownload = @a_viewtorrenthttp rwdtorrentwindowtwo end $temptorrentnumber = 0 def runtorrentthread $torrenttimestart = Time.now Dir.chdir($rwdtorrentdownloads) $bt = RubyTorrent::BitTorrent.new("#{$torrenttodownload}") $torrentpid = fork do puts "\nIn child, pid = #$$ \n" thread = Thread.new do #while true puts $bt.percent_completed #end end $bt.on_event(self, :complete) { thread.kill } thread.join end end def rwdtorrentwindowtwo require 'extras/rubytorrent' @rwd_call_after_back << "rwdtorrentwindowtwo" #if @rwd_tab== "rwdtorrentrefresh" @rwd_window = "torrentdisplaywindowtwo" # end if $temptorrentnumber == 0 runtorrentthread $temptorrentnumber =1 end Dir.chdir($progdir) @torrentdisplayvariable = $bt.percent_completed.to_s @torrentstarttime = $torrenttimestart @torrentcurrenttime = Time.now.to_s commandtext = TorrentListCmd + $rwdtorrentdownloads + "/" + @a_viewtorrent.to_s + "*" begin # exception trapped block @torrentcurrentsize =`#{commandtext}` rescue SystemCallError, StandardError $stderr.print "system call error: " + $! end # exception rescue end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rwdtorrent-0.02 | code/superant.com.rwdtorrent/runtorrentwindow.rb |