bin/preprocess.py
def check_blog_sanity(posts):
    '''Make sure all blog posts have sensible metadata.'''
    seen = {}
    errors = False
    for p in posts:
        timestamp = (p['date'], p['time'])
        if timestamp in seen:
            print('Timestamp {0} in {1} duplicated in {2}'.format(timestamp, seen[timestamp], p['path']), file=sys.stderr)
            errors = True
        else:
            seen[timestamp] = p['path']
    if errors:
        sys.exit(1)
Make sure all blog posts have sensible metadata.
Make sure all blog posts have sensible metadata.
Make sure all blog posts have sensible metadata .
def check_blog_sanity(posts):
    seen = {}
    errors = False
    for p in posts:
        timestamp = (p['date'], p['time'])
        if timestamp in seen:
            print('Timestamp {0} in {1} duplicated in {2}'.format(timestamp, seen[timestamp], p['path']), file=sys.stderr)
            errors = True
        else:
            seen[timestamp] = p['path']
    if errors:
        sys.exit(1)
def check_blog_sanity ( posts ) : seen = { } errors = False for p in posts : timestamp = ( p [ 'date' ] , p [ 'time' ] ) if timestamp in seen : print ( 'Timestamp {0} in {1} duplicated in {2}' . format ( timestamp , seen [ timestamp ] , p [ 'path' ] ) , file = sys . stderr ) errors = True else : seen [ timestamp ] = p [ 'path' ] if errors : sys . exit ( 1 )
Make sure all blog posts have sensible metadata.
Make sure all blog posts have sensible metadata .
'''Make sure all blog posts have sensible metadata.'''
posts