def FilePic(myPicture,myOutputDir,myDateSort):
    """
    Files the specified picture in the OutputDir according to EXIF Camera Model and date:
    /myOutputDir
        /<EXIF Camera Model>
            /<year>
                /<month>
                    /<date>  (optional)
                        /<myPicture>
    """
    # Check for/make dirs for file to go into
    # If dir already exists, use it - if it doesn't exist, then create it

    try:
        f=open(myPicture, 'rb')
        tags=EXIF.process_file(f)
        myFilename=os.path.basename(myPicture)
        datestr = str(tags['EXIF DateTimeDigitized'])
        datestr = datestr.split(' ')
        dt = datestr[0]  # date
        tm = datestr[1]  # time
        # Date
        y = dt.split(':')[0]    # year
       
        if len(dt.split(':')[1]) < 2:   # month
            m = str('0') + dt.split(':')[1] 
        else:
            m = dt.split(':')[1]
           
        if len(dt.split(':')[2]) < 2:   # day
            d = str('0') + dt.split(':')[2] 
        else:
            d = dt.split(':')[2]

        # Time
        h = tm.split(':')[0]  # hour
        min = tm.split(':')[1]  # minute
        s = tm.split(':')[2]  # second

        camera=str(tags['Image Model'])
        if os.path.isdir(myOutputDir + '/' + camera) != 1:
            os.mkdir(myOutputDir + '/' + camera)
        if os.path.isdir(myOutputDir + '/' + camera + '/' + y) != 1:
            os.mkdir(myOutputDir + '/' + camera + '/' + y)
        if os.path.isdir(myOutputDir + '/' + camera + '/' + y + '/' + m) != 1:
            os.mkdir(myOutputDir + '/' + camera + '/' + y + '/' + m)
        if dateSort:
            if os.path.isdir(myOutputDir + '/' + camera + '/' + y + '/' + m + '/' + d) != 1:
                os.mkdir(myOutputDir + '/' + camera + '/' + y + '/' + m + '/' + d)

        # Copy file, renaming it with new filename
        if myDateSort:
            myNewFilePath=myOutputDir + '/' + camera + '/' + y + '/' + m + '/' + d + '/' + myFilename
        else:
            myNewFilePath=myOutputDir + '/' + camera + '/' + y + '/' + m + '/' + myFilename

        print 'New File: %s' % (myNewFilePath)
        shutil.copyfile(myPicture,myNewFilePath)
            
        # Set modified time to date photo was digitized
        myCurrentTime = datetime.datetime.now()
        myCurrentTime = int(time.mktime(myCurrentTime.timetuple()))
        myDigitizedTime = datetime.datetime(int(y), int(m), int(d), int(h), int(min), int(s))
        myDigitizedTime = int(time.mktime(myDigitizedTime.timetuple()))
        myTimes=(myCurrentTime,myDigitizedTime)
        os.utime(myNewFilePath,myTimes)
    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"

    Files the specified picture in the OutputDir according to EXIF Camera Model and date:
    /myOutputDir
        /<EXIF Camera Model>
            /<year>
                /<month>
                    /<date>  (optional)
                        /<myPicture>
    
recipes/Python/511439_PhotoLibrarian/recipe-511439.py