Permalink
Browse files

updated docs, fixed some inaccuracies in stat generation, some new fi…

…lters
  • Loading branch information...
1 parent 64e6359 commit 578a113cdb5f0c16eea30a2286ecf7d6e8355f47 @cathywu committed Jan 20, 2012
Showing with 18 additions and 15 deletions.
  1. +7 −0 README
  2. +0 −5 src/focus.py
  3. +3 −1 src/focus_globals.py
  4. +8 −9 src/stats.py
View
7 README
@@ -1,3 +1,10 @@
+=== SUPPORTED PLATFORMS ===
+Known to work on:
+Ubuntu 10.04
+
+Know to NOT work on:
+Ubuntu 11.04
+
=== DEPENDENCIES ===
* python-gnomeapplet
* xprintidle
View
@@ -96,8 +96,3 @@ def __init__(self, base):
gtk.main()
sys.exit()
-
-
-
-
-
View
@@ -21,4 +21,6 @@
('Feedly', 'f \| '),
('Anki', 'Anki'),
('Stack Overflow', 'Stack Overflow'),
- ('TED', 'on TED\.com|TED:')]
+ ('TED', 'on TED\.com|TED:'),
+ ('Mundane', 'TODO'),
+ ('Wikipedia', 'Wikipedia, the free encyclopedia')]
View
@@ -82,17 +82,16 @@ def sortedByPop(dic):
date = matches['date']
device = matches['device']
- if date in counts:
- print "Passing on %s" % afile
- continue
+ if not date in counts:
+ counts[date] = {}
- counts[date] = {}
- print "debug %s" % afile
- indices[date] = index([x.split("=>", 1)[1] for x in fileinput.input(glob.glob("%s-*.txt" % date))])
+ if not date in indices:
+ indices[date] = index([x.split("=>", 1)[1] for x in fileinput.input(glob.glob("%s-*.txt" % date))])
for (fname,fpattern) in FILTERS:
- if not fname in counts[date]:
- counts[date][fname] = 0
+ if fname in counts[date]:
+ continue
+ counts[date][fname] = 0
for log in fileinput.input(glob.glob("%s-*.txt" % date)):
if re.search(fpattern,u(log), re.UNICODE):
counts[date][fname] += 1
@@ -130,7 +129,7 @@ def sortedByPop(dic):
print "=== Averages for last %s days (min) ==============================" % i
days = ordered_counts[-i-1:-1]
- indices = aggregate_ls([k[1] for k in ordered_indices][-i:])
+ indices = aggregate_ls([k[1] for k in ordered_indices][-i-1:-1])
print "\n".join([x + " " + str(len(indices[x])/(60*i)) for x in sortedByPop(indices)[:15]])
totals = {}

0 comments on commit 578a113

Please sign in to comment.