()
| 140 | @api.route('/setup/printer', methods=['GET']) |
| 141 | @not_setup_only |
| 142 | def 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 |
nothing calls this directly
no test coverage detected