From 87b47c329bf60c336303f228e11ece571dbe91de Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Wed, 22 May 2013 21:48:47 +0000 Subject: pep8 and pyflakes cleanup --- (limited to 'pysamples/journal-stats.py') diff --git a/pysamples/journal-stats.py b/pysamples/journal-stats.py index 2d8a5d3..1342a69 100644 --- a/pysamples/journal-stats.py +++ b/pysamples/journal-stats.py @@ -14,15 +14,17 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + def myblock(tw, x): # ignore second argument ''' Load journal stats to heap (Sugar only) ''' import os import glob + from gettext import gettext as _ + MAX = 19 DIROFINTEREST = 'datastore' - class ParseJournal(): ''' Simple parser of datastore ''' @@ -78,7 +80,6 @@ def myblock(tw, x): # ignore second argument activity_list.append([_('other'), count]) return activity_list - def hascomponent(path, component): ''' Return metadata attribute, if any ''' if not os.path.exists(os.path.join(path, 'metadata')): @@ -92,7 +93,6 @@ def myblock(tw, x): # ignore second argument return False return data - def isactivity(path): ''' Return activity name ''' activity = hascomponent(path, 'activity') @@ -101,7 +101,6 @@ def myblock(tw, x): # ignore second argument else: return activity.split('.')[-1] - def isdsdir(path): ''' Only interested if it is a datastore directory ''' if not os.path.isdir(path): @@ -110,12 +109,11 @@ def myblock(tw, x): # ignore second argument return False return True - data = ParseJournal() activity_list = data.get_sorted() for a in activity_list: tw.lc.heap.append(a[0]) tw.lc.heap.append(a[1]) - + tw.lc.heap.append(activity_list[0][1]) return -- cgit v0.9.1