def getFileContentsOrParameterValue(filePathOrValue):
    """Return list of file contents if parameter is file path, otherwise
    parameter as first entry."""

    data = []
    if os.path.isfile(filePathOrValue):
        with open(filePathOrValue) as foSrc:
            for srcLine in foSrc:
                data.append(srcLine.strip())
    else:
        data.append(filePathOrValue)
    return data
Return list of file contents if parameter is file path, otherwise
    parameter as first entry.
recipes/Python/576807_Send_Email/recipe-576807.py