src/eric7/CodeFormatting/IsortFormattingDialog.py

branch
eric7
changeset 9465
8a020c34dce2
parent 9460
0d1b5d0fd815
child 9468
a4d8091cd8f7
equal deleted inserted replaced
9464:cbbeebc5c5dd 9465:8a020c34dce2
77 77
78 self.progressBar.setMaximum(len(filesList)) 78 self.progressBar.setMaximum(len(filesList))
79 79
80 self.resultsList.header().setSortIndicator(1, Qt.SortOrder.AscendingOrder) 80 self.resultsList.header().setSortIndicator(1, Qt.SortOrder.AscendingOrder)
81 81
82 self.__project = project
83
82 self.__config = copy.deepcopy(configuration) 84 self.__config = copy.deepcopy(configuration)
83 self.__config["quiet"] = True # we don't want extra output 85 self.__config["quiet"] = True # we don't want extra output
84 self.__config["overwrite_in_place"] = True # we want to overwrite the files 86 self.__config["overwrite_in_place"] = True # we want to overwrite the files
85 if "config_source" in self.__config: 87 if "config_source" in self.__config:
86 del self.__config["config_source"] 88 del self.__config["config_source"]
87 self.__isortConfig = Config(**self.__config) 89
90 # Create an isort Config object and pre-load it with parameters contained in
91 # project specific configuration files (like pyproject.toml). The configuration
92 # given as a dictionary (i.e. data entered in the configuration dialog)
93 # overwrites these. If the project is not passed, the isort config is based on
94 # the isort defaults.
95 self.__isortConfig = (
96 Config(settings_path=project.getProjectPath(), **self.__config)
97 if project
98 else Config(**self.__config)
99 )
100
88 self.__config["__action__"] = action # needed by the workers 101 self.__config["__action__"] = action # needed by the workers
89 self.__project = project
90 102
91 self.__filesList = filesList[:] 103 self.__filesList = filesList[:]
92 104
93 self.__diffDialog = None 105 self.__diffDialog = None
94 106
360 self.__statistics.failureCount += 1 372 self.__statistics.failureCount += 1
361 isError = True 373 isError = True
362 374
363 if status != "skipped": 375 if status != "skipped":
364 self.__statistics.processedCount += 1 376 self.__statistics.processedCount += 1
365
366 if self.__project:
367 filename = self.__project.getRelativePath(filename)
368 377
369 itm = QTreeWidgetItem( 378 itm = QTreeWidgetItem(
370 self.resultsList, 379 self.resultsList,
371 [ 380 [
372 statusMsg, 381 statusMsg,

eric ide

mercurial