/soc/2012/sanket/www-statscollector: 3a2d02074a3d: [ENHANCEMENT]...

sanket sanket at soc.pidgin.im
Wed Aug 8 02:21:28 EDT 2012


Changeset: 3a2d02074a3df1f1983bd7df8f6ad8577f8afb7c
Author:	 sanket <sanket at soc.pidgin.im>
Date:	 2012-08-07 23:21 +0530
Branch:	 default
URL: http://hg.pidgin.im/soc/2012/sanket/www-statscollector/rev/3a2d02074a3d

Description:

[ENHANCEMENT] Don't display ``other'' plugins-bar as they overwhelm'

diffstat:

 pidgin_stats_collector/display/views.py             |  11 +----------
 pidgin_stats_collector/templates/display/index.html |   1 +
 2 files changed, 2 insertions(+), 10 deletions(-)

diffs (32 lines):

diff --git a/pidgin_stats_collector/display/views.py b/pidgin_stats_collector/display/views.py
--- a/pidgin_stats_collector/display/views.py
+++ b/pidgin_stats_collector/display/views.py
@@ -269,16 +269,7 @@ def sorted_dict(d, f=None, cut=None):
   else:
     l = sorted(l, key=lambda x: -x[1])
 
-  k_arr, d_arr = [[i[0] for i in l], [i[1] for i in l]]
-
-  if(cut):
-    k_arr = k_arr[:cut]
-    k_arr.append('other')
-
-    s = sum(d_arr[cut:])
-    d_arr = d_arr[:cut]
-    d_arr.append(s)
-
+  k_arr, d_arr = [[i[0] for i in l[:cut]], [i[1] for i in l[:cut]]]
 
   return [k_arr, d_arr]
 
diff --git a/pidgin_stats_collector/templates/display/index.html b/pidgin_stats_collector/templates/display/index.html
--- a/pidgin_stats_collector/templates/display/index.html
+++ b/pidgin_stats_collector/templates/display/index.html
@@ -113,6 +113,7 @@
         <h2>User Information</h2>
         <div id="ui" style="min-width: 400px; height: 400px; margin: 0 auto"></div>
 
+        <h2>Top Plugins</h2>
 		<h4><a href="plugins-detail">(details)</a></h4>
 		<div id="plugins" style="min-width: 400px; min-height: 4	00px; margin: 0 auto"></div>
 



More information about the Commits mailing list