I was looking at
this post, and added a bit to change the max upload rate in btlaunchmanycurses.py - hit + or - to increase / decrease, 0 to reset to unlimited. It should be possible to add manual reannounce and other things by adding to the "if kcmd ..." block in btlaunchmanycore.py.
Code:
diff -urN BitTornado-CVS/BitTornado/launchmanycore.py BitTornado-0.3.8/BitTornado/launchmanycore.py
--- BitTornado-CVS/BitTornado/launchmanycore.py 2004-07-10 11:48:22.000000000 -0400
+++ BitTornado-0.3.8/BitTornado/launchmanycore.py 2004-11-24 13:57:51.000000000 -0500
@@ -163,6 +163,8 @@
self.downloads = {}
self.counter = 0
self.doneflag = Event()
+ self.uptotal0 = 0
+ self.dntotal0 = 0
self.hashcheck_queue = []
self.hashcheck_current = None
@@ -230,6 +232,8 @@
def stats(self):
self.rawserver.add_task(self.stats, self.stats_period)
data = []
+ data.append(( 0, 0, 0, 0, 0, 0, 0, self.config['max_upload_rate'], 0, self.uptotal0, self.dntotal0, 0, 0, 0 ))
+
for hash in self.torrent_list:
cache = self.torrent_cache[hash]
if self.config['display_path']:
@@ -289,11 +293,33 @@
data.append(( name, status, progress, peers, seeds, seedsmsg, dist,
uprate, dnrate, upamt, dnamt, size, t, msg ))
- stop = self.Output.display(data)
- if stop:
+ kcmd = self.Output.display(data)
+ nr = self.config['max_upload_rate']
+ if kcmd in (ord('q'),ord('Q')):
self.doneflag.set()
+ elif kcmd == ord('+'):
+ nr += 1
+ elif kcmd == ord('-'):
+ nr -= 1
+ elif kcmd == ord('0'):
+ nr = 0
+
+ if nr != self.config['max_upload_rate']:
+ if nr < 1:
+ nr = 0
+ elif nr < 3:
+ nr = 3
+ self.config['max_upload_rate'] = nr
+ self.ratelimiter.set_upload_rate(nr)
+
def remove(self, hash):
+ d = self.downloads[hash]
+ stats = d.statsfunc()
+ s = stats['stats']
+ self.uptotal0 += s.upTotal
+ self.dntotal0 += s.downTotal
+
self.torrent_list.remove(hash)
self.downloads[hash].shutdown()
del self.downloads[hash]
diff -urN BitTornado-CVS/btlaunchmany.py BitTornado-0.3.8/btlaunchmany.py
--- BitTornado-CVS/btlaunchmany.py 2004-10-05 12:12:52.000000000 -0400
+++ BitTornado-0.3.8/btlaunchmany.py 2004-11-19 18:01:06.000000000 -0500
@@ -49,6 +49,8 @@
class HeadlessDisplayer:
def display(self, data):
print ''
+ ( name, status, progress, peers, seeds, seedsmsg, dist,
+ uprate, dnrate, upamt, dnamt, size, t, msg ) = data.pop(0)
if not data:
self.message('no torrents')
for x in data:
diff -urN BitTornado-CVS/btlaunchmanycurses.py BitTornado-0.3.8/btlaunchmanycurses.py
--- BitTornado-CVS/btlaunchmanycurses.py 2004-10-05 12:15:28.000000000 -0400
+++ BitTornado-0.3.8/btlaunchmanycurses.py 2004-11-24 14:03:29.000000000 -0500
@@ -126,14 +126,14 @@
self.headerpan = curses.panel.new_panel(self.headerwin)
self.headerwin.scrollok(0)
- self.totalwin = curses.newwin(1, self.mainwinw+1,
+ self.totalwin = curses.newwin(2, self.mainwinw+1,
self.mainwinh+1, self.mainwinx)
self.totalpan = curses.panel.new_panel(self.totalwin)
self.totalwin.scrollok(0)
- self.statuswinh = self.scrh-4-self.mainwinh
+ self.statuswinh = self.scrh-5-self.mainwinh
self.statuswin = curses.newwin(self.statuswinh, self.mainwinw+1,
- self.mainwinh+3, self.mainwinx)
+ self.mainwinh+4, self.mainwinx)
self.statuspan = curses.panel.new_panel(self.statuswin)
self.statuswin.scrollok(0)
@@ -223,6 +223,8 @@
self._remake_window()
self.mainwin.erase()
+ ( name, status, progress, peers, seeds, seedsmsg, dist,
+ maxupr, dnrate, totalupamt, totaldnamt, size, t, msg ) = data.pop(0)
if data:
self._display_data(data)
else:
@@ -234,21 +236,34 @@
uprate, dnrate, upamt, dnamt, size, t, msg ) in data:
totalup += uprate
totaldn += dnrate
+ totalupamt += upamt
+ totaldnamt += dnamt
totalup = '%s/s' % fmtsize(totalup)
totaldn = '%s/s' % fmtsize(totaldn)
+ totalupamt = '%s' % fmtsize(totalupamt)
+ totaldnamt = '%s' % fmtsize(totaldnamt)
self.totalwin.erase()
- self.totalwin.addnstr(0, self.mainwinw-27, 'Totals:', 7, curses.A_BOLD)
+ if maxupr:
+ totalstr = 'Totals (MaxUL %sKB/s):' % maxupr
+ else:
+ totalstr = 'Totals (MaxUL unl):'
+ self.totalwin.addnstr(0, self.mainwinw-45 + (25-len(totalstr)),
+ totalstr, 25, curses.A_BOLD)
self.totalwin.addnstr(0, self.mainwinw-20 + (10-len(totaldn)),
totaldn, 10, curses.A_BOLD)
self.totalwin.addnstr(0, self.mainwinw-10 + (10-len(totalup)),
totalup, 10, curses.A_BOLD)
+ self.totalwin.addnstr(1, self.mainwinw-20 + (10-len(totaldnamt)),
+ totaldnamt, 10, curses.A_BOLD)
+ self.totalwin.addnstr(1, self.mainwinw-10 + (10-len(totalupamt)),
+ totalupamt, 10, curses.A_BOLD)
curses.panel.update_panels()
curses.doupdate()
- return inchar in (ord('q'),ord('Q'))
+ return inchar #in (ord('q'),ord('Q'))
def message(self, s):
self.messages.append(strftime('%x %X - ',localtime(time()))+s)