Anton Skrypnyk fda4b86cbc
0.1.0 (#34)
* Add separate class for sftp file system
* Add separate serial IO handling class
* Replace function name mangling with gcode handler registration system
* Add states to virtual Bambu printer that manage state specific interaction
* Add synchronization utilities to work with virtual printer as if it is a binary stream
* Add unittests with mocked Bambu printer to ensure core functionality works as expected
* Fix formatting to be automatically processed by black formatter
* Fix python 3.10 type annotations for readability
2024-07-29 22:49:12 -04:00

19 lines
425 B
Python

from __future__ import annotations
from dataclasses import dataclass
from octoprint_bambu_printer.printer.file_system.remote_sd_card_file_list import (
FileInfo,
)
@dataclass
class PrintJob:
file_info: FileInfo
progress: int
@property
def file_position(self):
if self.file_info.size is None:
return 0
return int(self.file_info.size * self.progress / 100)