@classmethod
    def from_path(cls, path, extension_required=False):
        path = os.path.abspath(path)
        if os.path.isfile(path) and (not extension_required or
                                     path.endswith('.lektorproject')):
            return cls.from_file(path)

        try:
            files = [x for x in os.listdir(path)
                     if x.lower().endswith('.lektorproject')]
        except OSError:
            return None

        if len(files) == 1:
            return cls.from_file(os.path.join(path, files[0]))

        if os.path.isdir(path) and \
           os.path.isfile(os.path.join(path, 'content/contents.lr')):
            return cls(
                name=os.path.basename(path),
                project_file=None,
                tree=path,
            )
User-callable function to return a unique temporary file name.  The
dataset/ETHPy150Open lektor/lektor-archive/lektor/project.py/Project.from_path--crossover with--dataset/ETHPy150Open eBay/restcommander/play-1.2.4/python/Lib/tempfile.py/mktemp