mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-30 22:31:21 -07:00
Add some documentation to factory and format file.
This commit is contained in:
parent
c097838614
commit
f49f8b3cb8
1 changed files with 8 additions and 5 deletions
|
|
@ -1,3 +1,4 @@
|
|||
from pathlib import Path
|
||||
from typing import Optional
|
||||
|
||||
from .linters.profile import Profile
|
||||
|
|
@ -6,15 +7,17 @@ from .linters.diagnostic_generator import DiagnosticGenerator
|
|||
from .linters.meshes import Meshes
|
||||
|
||||
|
||||
def create(file, settings) -> Optional[DiagnosticGenerator]:
|
||||
def create(file: Path, settings) -> Optional[DiagnosticGenerator]:
|
||||
""" Returns a DiagnosticGenerator depending on the file format """
|
||||
if not file.exists():
|
||||
return None
|
||||
if ".inst" in file.suffixes and ".cfg" in file.suffixes:
|
||||
elif ".inst" in file.suffixes and ".cfg" in file.suffixes:
|
||||
return Profile(file, settings)
|
||||
if ".def" in file.suffixes and ".json" in file.suffixes:
|
||||
elif ".def" in file.suffixes and ".json" in file.suffixes:
|
||||
if file.stem in ("fdmprinter.def", "fdmextruder.def"):
|
||||
return None
|
||||
return Definition(file, settings)
|
||||
if file.parent.stem == "meshes":
|
||||
elif file.parent.stem == "meshes":
|
||||
return Meshes(file, settings)
|
||||
return None
|
||||
|
||||
return None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue