debugging fn

master
nathaniel smith 2015-07-28 17:33:42 -07:00
parent b1e504331e
commit d070d6c2eb
2 changed files with 7 additions and 2 deletions

View File

@ -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)

View File

@ -9,3 +9,7 @@ def thread(initial, *fns):
for fn in fns:
value = fn(value)
return value
def p(x):
print(x)
return x