#378: Advanced (pieces) progress bar
-------------------+--------------------------------------------------------
 Reporter:  andar  |       Owner:  andar 
     Type:  patch  |      Status:  new   
 Priority:  major  |   Milestone:  Future
Component:  gtkui  |     Version:        
 Keywords:         |  
-------------------+--------------------------------------------------------

Comment(by s0undt3ch):

 {{{
 #!python
 >>> x = [3, 2, 1, 1, 1, 0, 0, 2, 0, 1, 0, 2, 0, 2, 1, 0, 2, 0, 0, 0,
 2, 0, 0, 0, 2, 0, 0, 2, 2, 1, 0, 2, 1, 0, 1, 1, 0, 0, 2, 0, 0, 0, 0,
 0, 0, 3, 3, 0, 0, 2, 0, 2, 2, 2, 0, 2, 2, 1]
 >>> t = len(x)*1.0
 >>> xx = []
 >>> v = x.pop(0)
 >>> n = 1
 >>> while True:
 ...     if not x:
 ...         break
 ...     vv = x.pop(0)
 ...     if vv == v:
 ...         n += 1
 ...     else:
 ...         xx.append(n/t)
 ...         n = 1
 ...
 >>> xx
 [0.017241379310344827, 0.017241379310344827, 0.017241379310344827,
 0.017241379310344827,
 0.017241379310344827, 0.017241379310344827, 0.017241379310344827,
 0.017241379310344827,
 0.017241379310344827, 0.017241379310344827, 0.017241379310344827,
 0.017241379310344827,
 0.017241379310344827, 0.017241379310344827, 0.017241379310344827,
 0.017241379310344827,
 0.017241379310344827, 0.017241379310344827, 0.017241379310344827,
 0.017241379310344827,
 0.017241379310344827, 0.017241379310344827, 0.017241379310344827,
 0.017241379310344827,
 0.017241379310344827, 0.017241379310344827, 0.017241379310344827,
 0.017241379310344827,
 0.017241379310344827, 0.017241379310344827, 0.017241379310344827,
 0.017241379310344827,
 0.017241379310344827, 0.017241379310344827, 0.017241379310344827,
 0.017241379310344827,
 0.017241379310344827, 0.017241379310344827, 0.017241379310344827,
 0.017241379310344827,
 0.017241379310344827, 0.017241379310344827, 0.017241379310344827,
 0.017241379310344827,
 0.051724137931034482, 0.017241379310344827, 0.017241379310344827,
 0.017241379310344827,
 0.017241379310344827, 0.017241379310344827, 0.017241379310344827,
 0.017241379310344827,
 0.017241379310344827, 0.017241379310344827, 0.017241379310344827]
 >>> len(xx)
 55
 >>> t
 58.0
 >>>
 }}}

 Didn't reduce that much, but the data was not helping much too ;)

 Is this the way to go?

 The final values and width percentages, considering 58 is 100%

-- 
Ticket URL: <http://dev.deluge-torrent.org/ticket/378#comment:21>
Deluge <http://deluge-torrent.org/>
Deluge project

-- 
You received this message because you are subscribed to the Google Groups 
"Deluge Dev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/deluge-dev?hl=en.

Reply via email to