mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-12 17:27:51 -06:00
don't shadow format function.
This commit is contained in:
parent
57ec36b7fe
commit
a809e5a91c
4 changed files with 5 additions and 5 deletions
|
@ -25,7 +25,7 @@ METADATA_SORT_PRIORITY = {
|
|||
|
||||
|
||||
class DefJsonFormatter(FileFormatter):
|
||||
def format(self, file: Path):
|
||||
def formatFile(self, file: Path):
|
||||
""" Format .def.json files according to the rules in settings.
|
||||
|
||||
You can assume that you will be running regex on standard formatted json files, because we load the json first and then
|
||||
|
|
|
@ -12,5 +12,5 @@ class FileFormatter(ABC):
|
|||
self._settings = settings
|
||||
|
||||
@abstractmethod
|
||||
def format(self, file: Path) -> None:
|
||||
def formatFile(self, file: Path) -> None:
|
||||
pass
|
|
@ -7,7 +7,7 @@ from pathlib import Path
|
|||
from .formatter import FileFormatter
|
||||
|
||||
class InstCfgFormatter(FileFormatter):
|
||||
def format(self, file: Path):
|
||||
def formatFile(self, file: Path):
|
||||
""" Format .inst.cfg files according to the rules in settings """
|
||||
config = configparser.ConfigParser()
|
||||
config.read(file)
|
||||
|
|
|
@ -94,11 +94,11 @@ def applyFormattingToFile(file: Path, settings) -> None:
|
|||
|
||||
if ext == "def.json":
|
||||
formatter = DefJsonFormatter(settings)
|
||||
formatter.format(file)
|
||||
formatter.formatFile(file)
|
||||
|
||||
if ext == "inst.cfg":
|
||||
formatter = InstCfgFormatter(settings)
|
||||
formatter.format(file)
|
||||
formatter.formatFile(file)
|
||||
|
||||
|
||||
def extractFilePaths(paths: List[Path]) -> List[Path]:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue