def get_all_migrations(self):
        if self.all_migrations:
            return self.all_migrations

        migrations = []

        for _dir in self._migrations_dir:
            path = os.path.abspath(_dir)

            dir_list = None
            try:
                dir_list = os.listdir(path)
            except __HOLE__:
                raise Exception("directory not found ('%s')" % path)

            for dir_file in dir_list:
                if dir_file.endswith(Migration.MIGRATION_FILES_EXTENSION) and Migration.is_file_name_valid(dir_file):
                    migration = Migration('%s/%s' % (path, dir_file), script_encoding=self._script_encoding)
                    migrations.append(migration)

        if len(migrations) == 0:
            raise Exception("no migration files found")

        self.all_migrations = Migration.sort_migrations_list(migrations)
        return self.all_migrations
dataset/ETHPy150Open guilhermechapiewski/simple-db-migrate/simple_db_migrate/core/__init__.py/SimpleDBMigrate.get_all_migrations