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

Function connection_settings

src/astroprint/api/setup.py:142–167  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

140@api.route('/setup/printer', methods=['GET'])
141@not_setup_only
142def connection_settings():
143 connectionOptions = printerManager().getConnectionOptions()
144
145 if connectionOptions:
146
147 plugins = pluginManager().getPluginsByProvider('printerComms')
148
149 driverChoices = { ("plugin:%s" % k) : plugins[k].definition['name'] for k in plugins }
150
151 driverChoices.update({
152 'marlin': 'GCODE - Marlin / Repetier Firmware',
153 's3g': 'X3G - Sailfish / Makerbot Firmware'
154 })
155
156 response = {
157 "driver": printerProfileManager().data['driver'],
158 "driverChoices": driverChoices,
159 "port": connectionOptions["portPreference"],
160 "baudrate": connectionOptions["baudratePreference"],
161 "portOptions": connectionOptions["ports"].items(),
162 "baudrateOptions": connectionOptions["baudrates"]
163 }
164
165 return jsonify(response)
166
167 return make_response("Connection options not available", 400)
168
169@api.route('/setup/printer', methods=['POST'])
170@not_setup_only

Callers

nothing calls this directly

Calls 6

printerManagerFunction · 0.90
pluginManagerFunction · 0.90
printerProfileManagerFunction · 0.90
getPluginsByProviderMethod · 0.80
updateMethod · 0.80
getConnectionOptionsMethod · 0.45

Tested by

no test coverage detected