the forums at degreez.net
http://forums.degreez.net/

Control # of message lines on btlaunchmanycurses
http://forums.degreez.net/viewtopic.php?f=4&t=7572
Page 1 of 1

Author:  dstar [ Mon May 04, 2009 9:15 pm ]
Post subject:  Control # of message lines on btlaunchmanycurses

Is there any way to limit the number of log messages at the bottom of the btlaunchmanycurses screen? I've got ten lines devoted to that right now, and I'd rather only have 4, letting me see more torrent info at a time...

Author:  TheSHAD0W [ Wed May 06, 2009 3:41 am ]
Post subject: 

You can hack btlaunchmanycurses.py to change the main window height; it's calculated at line 112, "self.mainwinh = int(2*(self.scrh)/3)". Changing it to 4*(self.scrh)/5 may give you what you want. Beware though, it may blow up on you if you then make the window too small.

Author:  dstar [ Wed May 06, 2009 12:42 pm ]
Post subject: 

TheSHAD0W wrote:
You can hack btlaunchmanycurses.py to change the main window height; it's calculated at line 112, "self.mainwinh = int(2*(self.scrh)/3)". Changing it to 4*(self.scrh)/5 may give you what you want. Beware though, it may blow up on you if you then make the window too small.


Thanks -- I'll give that a look.

Author:  dstar [ Fri May 08, 2009 11:00 am ]
Post subject: 

dstar wrote:
TheSHAD0W wrote:
You can hack btlaunchmanycurses.py to change the main window height; it's calculated at line 112, "self.mainwinh = int(2*(self.scrh)/3)". Changing it to 4*(self.scrh)/5 may give you what you want. Beware though, it may blow up on you if you then make the window too small.


Thanks -- I'll give that a look.


I've been considering this further, and I think that I confused my goal with one way of achieving it. I often have a dozen or two torrents running, most of which aren't doing anything (I'm seeding them, but no one is downloading at the moment), and it takes a long time to cycle through to see the one or two active torrents. If there was a way to only show active torrents, that would be perfect.

Would it work to modify _display_data to operate on a copy of its data argument that's had inactive torrents removed? If so, you could bind a key to a method that toggles a variable, and check that at the beginning of _display_data to determine whether or not to display inactive torrents.

I'm not at all familiar with python, so I'm not sure if that would work or not. It looks like it might, but I could be wrong.

Author:  dstar [ Fri May 08, 2009 12:56 pm ]
Post subject: 

dstar wrote:
Would it work to modify _display_data to operate on a copy of its data argument that's had inactive torrents removed? If so, you could bind a key to a method that toggles a variable, and check that at the beginning of _display_data to determine whether or not to display inactive torrents.

I'm not at all familiar with python, so I'm not sure if that would work or not. It looks like it might, but I could be wrong.


Worked like a charm. I renamed the data argument to data_arg, and added this at the beginning of _display_data (and some other code elsewhere to toggle show_inactive when I hit the spacebar):
Code:
        if self.show_inactive:
            data = data_arg
        else:
            data = [x for x in data_arg if (x[3] > 0 or x[4] > 0) and (x[9] > 100 or x[8] > 100)]
            data.sort(lambda a,b: cmp(a[1],b[1]) or cmp(a[13],b[13]) or cmp(b[2],a[2])  or cmp(b[9],a[9]) or cmp(b[8],a[8]) or cmp(b[4],a[4]) \
or cmp(b[3],a[3]))


I'm checking both that it has a peer, and that it's sending or receiving at least 100 bytes/s. I added the second check because I had several torrents that had clients connecting and disconnecting without actually downloading anything, causing the display to flicker.

Would you be interested in a patch to add this?

Page 1 of 1 All times are UTC - 7 hours [ DST ]
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/