MCPcopy Create free account
hub / github.com/AstroPrint/AstroBox / _analyzeFile

Method _analyzeFile

src/astroprint/printfiles/gcode.py:46–65  ·  view source on GitHub ↗
(self, filename)

Source from the content-addressed store, hash-verified

44 self._gcode.abort()
45
46 def _analyzeFile(self, filename):
47 path = self._getPathCallback(filename)
48
49 if path is None or not os.path.exists(path):
50 return
51
52 self._currentFile = filename
53 self._currentProgress = 0
54
55 try:
56 self._logger.debug("Starting analysis of file %s" % filename)
57 eventManager().fire(Events.METADATA_ANALYSIS_STARTED, {"file": filename})
58 self._gcode = GcodeInterpreter(self._loadedCallback,self._currentFile)
59 self._gcode.progressCallback = self._onParsingProgress
60 self._gcode.load(path)
61
62 finally:
63 self._gcode = None
64 self._currentProgress = None
65 self._currentFile = None
66
67class GcodeInterpreter(object):
68 def __init__(self,loadedCallback,currentFile):

Callers

nothing calls this directly

Calls 4

eventManagerFunction · 0.90
GcodeInterpreterClass · 0.85
fireMethod · 0.80
loadMethod · 0.45

Tested by

no test coverage detected