def WriteByLine(base, newName, y, m, d):
    """
    Writes author info to the IPTC metadata of jpeg. Does test on original filename
    to see which camera it came from, if Nikon, I took it with my D70; if HP, 
    Will took it with his camera
    --------------------------------------------------------------------------
    Inputs:
    base:        Base directory for photos --> '/Users/chad/Pictures/testing'
    newName :    New filename as result of RenameFile --> 0000_yyyy-mm-dd_hh-mm-ss_00mm.jpg
    y:           Year from DateTimeDigitized Exif tag
    m:           Month from DateTimeDigitized Exif tag
    d:           Day from DateTimeDigitized Exif tag
    --------------------------------------------------------------------------    
    """
    try:
        info = IPTCInfo(os.path.join(base, y, m, d, newName))
        # Test to see who took the pic, depending on the camera
        if filename[:2] == 'HP':
            info.data['by-line'] = 'William L.R. Booher'
            info.data['keywords'] = ['taken by will']
        elif filename[:3] == 'DSC':
            info.data['by-line'] = 'Chad D. Cooper'
        else:
            info.data['by-line'] = ''
        info.saveAs(os.path.join(base, y, m, d, newName))
    except:
        tb = sys.exc_info()[2]
        tbinfo = traceback.format_tb(tb)[0]
        pymsg = "PYTHON ERRORS:\nTraceback Info:\n" + tbinfo + "\nError Info:\n    " + \
                str(sys.exc_type)+ ": " + str(sys.exc_value) + "\n"

    Writes author info to the IPTC metadata of jpeg. Does test on original filename
    to see which camera it came from, if Nikon, I took it with my D70; if HP, 
    Will took it with his camera
    --------------------------------------------------------------------------
    Inputs:
    base:        Base directory for photos --> '/Users/chad/Pictures/testing'
    newName :    New filename as result of RenameFile --> 0000_yyyy-mm-dd_hh-mm-ss_00mm.jpg
    y:           Year from DateTimeDigitized Exif tag
    m:           Month from DateTimeDigitized Exif tag
    d:           Day from DateTimeDigitized Exif tag
    --------------------------------------------------------------------------    
    
recipes/Python/500266_Cataloging_adding_IPTC_keywords_digital/recipe-500266.py