'Find yaml files in application directory.
Args:
basepath: Base application directory.
file_name: Relative file path from basepath, without extension, to search
for.
Returns:
Path to located yaml file if one exists, else None.'

def _FindYaml(self, basepath, file_name):

    if (not os.path.isdir(basepath)):
        self.parser.error(('Not    a    directory:    %s' % basepath))
    alt_basepath = os.path.join(basepath, 'WEB-INF', 'appengine-generated')
    for yaml_basepath in (basepath, alt_basepath):
        for yaml_file in ((file_name + '.yaml'), (file_name + '.yml')):
            yaml_path = os.path.join(yaml_basepath, yaml_file)
            if os.path.isfile(yaml_path):
                return yaml_path
    return None
