Beispiel #1
0
def listdir(path):
    fdict = file_manager.open_project(path)
    for each_folder in fdict:
        files, folders = fdict[each_folder]
        yield each_folder
        for each_file in files:
            yield os.path.join(each_folder, each_file)
Beispiel #2
0
def listdir(path):
    fdict = file_manager.open_project(path)
    for each_folder in fdict:
        files, folders = fdict[each_folder]
        yield each_folder
        for each_file in files:
            yield os.path.join(each_folder, each_file)
Beispiel #3
0
    def _thread_open_project(self):
        try:
            project = json_manager.read_ninja_project(self._folder_path)
            extensions = project.get('supported-extensions',
                                     settings.SUPPORTED_EXTENSIONS)
            if extensions != settings.SUPPORTED_EXTENSIONS:
                structure = file_manager.open_project_with_extensions(
                    self._folder_path, extensions)
            else:
                structure = file_manager.open_project(self._folder_path)

            self.folderDataAcquired.emit((self._folder_path, structure))
        except:
            self.folderDataAcquired.emit((self._folder_path, None))
    def _thread_open_project(self):
        try:
            project = json_manager.read_ninja_project(self._folder_path)
            extensions = project.get('supported-extensions',
                settings.SUPPORTED_EXTENSIONS)
            if extensions != settings.SUPPORTED_EXTENSIONS:
                structure = file_manager.open_project_with_extensions(
                    self._folder_path, extensions)
            else:
                structure = file_manager.open_project(self._folder_path)

            self.folderDataAcquired.emit((self._folder_path, structure))
        except:
            self.folderDataAcquired.emit((self._folder_path, None))
Beispiel #5
0
    def _thread_refresh_project(self):
        if self._extensions != settings.SUPPORTED_EXTENSIONS:
            folderStructure = file_manager.open_project_with_extensions(
                self._folder_path, self._extensions)
        else:
            try:
                folderStructure = file_manager.open_project(self._folder_path)
            except NinjaIOException:
                pass  # There is not much we can do at this point

        if folderStructure and (folderStructure.get(
                self._folder_path, [None, None])[1] is not None):
            folderStructure[self._folder_path][1].sort()
            values = (self._folder_path, self._item, folderStructure)
            self.emit(SIGNAL("folderDataRefreshed(PyQt_PyObject)"), values)
Beispiel #6
0
    def _thread_refresh_project(self):
        if self._extensions != settings.SUPPORTED_EXTENSIONS:
            folderStructure = file_manager.open_project_with_extensions(
                self._folder_path, self._extensions)
        else:
            try:
                folderStructure = file_manager.open_project(self._folder_path)
            except NinjaIOException:
                pass  # There is not much we can do at this point

        if folderStructure and (folderStructure.get(self._folder_path,
                                                [None, None])[1] is not None):
            folderStructure[self._folder_path][1].sort()
            values = (self._folder_path, self._item, folderStructure)
            self.emit(SIGNAL("folderDataRefreshed(PyQt_PyObject)"), values)
Beispiel #7
0
 def _thread_load_projects(self, projects):
     structures = []
     for pathProject in projects:
         folderStructure = file_manager.open_project(pathProject)
         structures.append((folderStructure, pathProject))
     self._thread_execution.storage_values = structures
Beispiel #8
0
 def _thread_load_projects(self, projects):
     structures = []
     for pathProject in projects:
         folderStructure = file_manager.open_project(pathProject)
         structures.append((folderStructure, pathProject))
     self._thread_execution.storage_values = structures