From d070d6c2eb4529e34af3b44942bac4995abf9d77 Mon Sep 17 00:00:00 2001 From: nathaniel smith Date: Tue, 28 Jul 2015 17:33:42 -0700 Subject: [PATCH] debugging fn --- tildetown-py/stats.py | 5 +++-- tildetown-py/util.py | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/tildetown-py/stats.py b/tildetown-py/stats.py index 40f2fbb..dcfbc8f 100644 --- a/tildetown-py/stats.py +++ b/tildetown-py/stats.py @@ -4,13 +4,12 @@ from os import listdir from os.path import getmtime, join from datetime import datetime from sh import find, facter -from util import slurp, thread +from util import slurp, thread, p # this script emits json on standard out that has information about tilde.town # users. It denotes who has not updated their page from the default. It also # reports the time this script was run. The user list is sorted by public_html update time. - DEFAULT_HTML = slurp("/etc/skel/public_html/index.html") username_to_html_path = lambda u: "/home/{}/public_html".format(u) @@ -29,11 +28,13 @@ def guarded_mtime(path): return 0 def modify_time(username): + p(username) files_to_mtimes = partial(map, guarded_mtime) return thread(username, username_to_html_path, bounded_find, files_to_mtimes, + p list, max) diff --git a/tildetown-py/util.py b/tildetown-py/util.py index 4657510..3b1fd5d 100644 --- a/tildetown-py/util.py +++ b/tildetown-py/util.py @@ -9,3 +9,7 @@ def thread(initial, *fns): for fn in fns: value = fn(value) return value + +def p(x): + print(x) + return x