"""
Name: 'berlin-clock.py'
Blender: 27x
Group: 'Example'
Tooltip: 'Creating the berlin-clock'
"""
import datetime


def timing():
    '''
    extrakt all parts of a timeobject    
    '''
    result = {}
    t = datetime.datetime.now()

    # seconds
    result["seconds"] = t.second % 2 == 0

    # 5-hour parts
    result["hour_01"] = (t.hour > 4)
    result["hour_02"] = (t.hour > 9)
    result["hour_03"] = (t.hour > 14)
    result["hour_04"] = (t.hour > 19)

    # 1-hour parts
    h = t.hour % 5
    result["hour_05"] = (h > 0)
    result["hour_06"] = (h > 1)
    result["hour_07"] = (h > 2)
    result["hour_08"] = (h > 3)

    # 5-minute parts
    result["minute_01"] = (t.minute > 4)
    result["minute_02"] = (t.minute > 9)
    result["minute_03"] = (t.minute > 14)
    result["minute_04"] = (t.minute > 19)
    result["minute_05"] = (t.minute > 24)
    result["minute_06"] = (t.minute > 29)
    result["minute_07"] = (t.minute > 34)
    result["minute_08"] = (t.minute > 39)
    result["minute_09"] = (t.minute > 44)
    result["minute_10"] = (t.minute > 49)
    result["minute_11"] = (t.minute > 54)

    # 1-minute parts
    m = t.minute % 5
    result["minute_12"] = (m > 0)
    result["minute_13"] = (m > 1)
    result["minute_14"] = (m > 2)
    result["minute_15"] = (m > 3)

    return result


if __name__ == '__main__':
    timing()