metadata: Add printer model and profile version
Adds `printer_vendor`, `printer_model`, `printer_variant`, and `profile_version` to parsed metadata. Currently only parsed for PrusaSlicer derivatives. Signed-off-by: Franklyn Tackitt <git@frank.af>
This commit is contained in:
1 parent
e8d4a66fc9
commit
4ba6fd228f
2 files changed
+26
No files matched your search
@@ -11,6 +11,8 @@ The format is based on [Keep a Changelog].
|
||||
|
||||
### Added
|
||||
- **metadata**: Auto-detect forks of PrusaSlicer.
|
||||
- **metadata**: Add `printer_vendor`, `printer_model`, `printer_variant`,
|
||||
and `profile_version` parsing for PrusaSlicer derivatives.
|
||||
|
||||
## [0.10.0] - 2026-01-21
|
||||
|
||||
|
||||
@@ -323,6 +323,18 @@ class BaseSlicer(metaclass=SlicerType):
|
||||
def parse_filament_weights(self) -> Optional[List[float]]:
|
||||
return None
|
||||
|
||||
def parse_printer_vendor(self) -> Optional[str]:
|
||||
return None
|
||||
|
||||
def parse_printer_model(self) -> Optional[str]:
|
||||
return None
|
||||
|
||||
def parse_printer_variant(self) -> Optional[str]:
|
||||
return None
|
||||
|
||||
def parse_profile_version(self) -> Optional[str]:
|
||||
return None
|
||||
|
||||
def parse_thumbnails(self) -> Optional[List[Dict[str, Any]]]:
|
||||
parsed_matches: List[Dict[str, Any]] = []
|
||||
has_miniature: bool = False
|
||||
@@ -621,6 +633,18 @@ class PrusaSlicer(BaseSlicer):
|
||||
return res
|
||||
return regex_find_int(r"; total filament change = (%D)", self.config_data)
|
||||
|
||||
def parse_printer_vendor(self) -> Optional[str]:
|
||||
return regex_find_string(r'; printer_vendor = (%S)', self.footer_data)
|
||||
|
||||
def parse_printer_model(self) -> Optional[str]:
|
||||
return regex_find_string(r'; printer_model = (%S)', self.footer_data)
|
||||
|
||||
def parse_printer_variant(self) -> Optional[str]:
|
||||
return regex_find_string(r'; printer_variant = (%S)', self.footer_data)
|
||||
|
||||
def parse_profile_version(self) -> Optional[str]:
|
||||
return regex_find_string(r'; profile_version = (%S)', self.footer_data)
|
||||
|
||||
class Slic3rPE(PrusaSlicer):
|
||||
@classmethod
|
||||
def identify(cls, data: str) -> Tuple[str, str] | None:
|
||||
|
||||
Reference in new issue
Block a user