示例#1
0
    def __load_projects(self):
        # For some reason matching against .yml files doesn't work, so let's look for all files.
        project_config_files = get_files_recursive(self.projects_folder, match='*')

        # There's no projects files to load, so let's make a dummy file and save it.
        if len(project_config_files) == 0:

            # Call the add projects plugin to perform the operation for a
            project = self.plugin_manager.get_plugin("addproject_operation").perform(
                config_location=self.app_config_folder)

            self.projects[project.name] = project

            for project in self.projects:
                with open(os.path.join(self.projects_folder, '%s.yml' % project.name), 'w') as project_new_config_file:
                    yaml.dump(project.yaml(), project_new_config_file, default_flow_style=False)

                logger.debug("Created Project File %s.yml" % project.name)

        # Now we loop through all the files in the projects directory and load them!
        for project_config_file in project_config_files:
            project = None
            with open(project_config_file, 'r') as project_file:
                project = Project.load(project_file)

                if project.name in self.projects:
                    logger.warning("Duplicate Project found [%s]" % project.name)
                    continue
                self.projects[project.name] = project

        logger.debug("Loaded Projects [%s] from config folder." % ",".join(name for name in self.projects.keys()))
示例#2
0
    def __load_projects(self):
        # For some reason matching against .yml files doesn't work, so let's look for all files.
        project_config_files = get_files_recursive(self.projects_folder,
                                                   match='*')

        # There's no projects files to load, so let's make a dummy file and save it.
        if len(project_config_files) == 0:

            # Call the add projects plugin to perform the operation for a
            project = self.plugin_manager.get_plugin(
                "addproject_operation").perform(
                    config_location=self.app_config_folder)

            self.projects[project.name] = project

            for project in self.projects:
                with open(
                        os.path.join(self.projects_folder,
                                     '%s.yml' % project.name),
                        'w') as project_new_config_file:
                    yaml.dump(project.yaml(),
                              project_new_config_file,
                              default_flow_style=False)

                logger.debug("Created Project File %s.yml" % project.name)

        # Now we loop through all the files in the projects directory and load them!
        for project_config_file in project_config_files:
            project = None
            with open(project_config_file, 'r') as project_file:
                project = Project.load(project_file)

                if project.name in self.projects:
                    logger.warning("Duplicate Project found [%s]" %
                                   project.name)
                    continue
                self.projects[project.name] = project

        logger.debug("Loaded Projects [%s] from config folder." %
                     ",".join(name for name in list(self.projects.keys())))
示例#3
0
 def get_jar_files(self):
     return get_files_recursive(self.files_folder, "*.jar")
示例#4
0
 def get_jar_files(self):
     return get_files_recursive(self.files_folder, "*.jar")