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

Method printerProfile

src/astroprint/plugin/services/system.py:198–223  ·  view source on GitHub ↗
(self, data, sendMessage)

Source from the content-addressed store, hash-verified

196
197 #profile
198 def printerProfile(self, data, sendMessage):
199
200 ppm = printerProfileManager()
201 pm = printerManager()
202 if data:
203 if 'driverChoices' in data:
204 del data['driverChoices']
205
206 if 'allowTerminal' in data:
207 del data['allowTerminal']
208
209 if 'check_clear_bed' in data and data['check_clear_bed'] is False:
210 pm.set_bed_clear(True)
211
212 ppm.set(data)
213 ppm.save()
214
215 sendMessage({'success': 'no_error'})
216 else:
217
218 result = ppm.data.copy()
219
220 result.update( {"allowTerminal": pm.allowTerminal} )
221 result.update( {"driverChoices": ppm.driverChoices()} )
222
223 sendMessage( result )
224
225 def manufacturers(self, data, sendMessage):
226 try:

Callers

nothing calls this directly

Calls 8

printerProfileManagerFunction · 0.90
printerManagerFunction · 0.90
updateMethod · 0.80
driverChoicesMethod · 0.80
set_bed_clearMethod · 0.45
setMethod · 0.45
saveMethod · 0.45
copyMethod · 0.45

Tested by

no test coverage detected