def _get_options(): connection_options = get_connection_options() profile_options = printerProfileManager.get_all() default_profile = printerProfileManager.get_default() options = dict( ports=connection_options["ports"], baudrates=connection_options["baudrates"], printerProfiles=[ dict(id=printer_profile["id"], name=printer_profile["name"] if "name" in printer_profile else printer_profile["id"]) for printer_profile in profile_options.values() if "id" in printer_profile ], projectProfiles=[ "OPTOMA", "acer_IR", "viewsonic_IR", "acer", "viewsonic", "user_define" ], portPreference=connection_options["portPreference"], portPreference1=connection_options["portPreference1"], baudratePreference=connection_options["baudratePreference"], printerProfilePreference=default_profile["id"] if "id" in default_profile else None, projector=connection_options["projector"], ) return options
def _get_options(): connection_options = printer.__class__.get_connection_options() profile_options = printerProfileManager.get_all() default_profile = printerProfileManager.get_default() options = { "ports": connection_options["ports"], "baudrates": connection_options["baudrates"], "printerProfiles": [{ "id": printer_profile["id"], "name": printer_profile["name"] if "name" in printer_profile else printer_profile["id"], } for printer_profile in profile_options.values() if "id" in printer_profile], "portPreference": connection_options["portPreference"], "baudratePreference": connection_options["baudratePreference"], "printerProfilePreference": default_profile["id"] if "id" in default_profile else None, } return options
def _get_options(): connection_options = getConnectionOptions() profile_options = printerProfileManager.get_all() default_profile = printerProfileManager.get_default() options = dict( ports=connection_options["ports"], baudrates=connection_options["baudrates"], printerProfiles=[dict(id=printer_profile["id"], name=printer_profile["name"] if "name" in printer_profile else printer_profile["id"]) for printer_profile in profile_options.values() if "id" in printer_profile], portPreference=connection_options["portPreference"], baudratePreference=connection_options["baudratePreference"], printerProfilePreference=default_profile["id"] if "id" in default_profile else None ) return options
def _get_options(): connection_options = printer.__class__.get_connection_options() profile_options = printerProfileManager.get_all() default_profile = printerProfileManager.get_default() options = dict( ports=connection_options["ports"], baudrates=connection_options["baudrates"], printerProfiles=[dict(id=printer_profile["id"], name=printer_profile["name"] if "name" in printer_profile else printer_profile["id"]) for printer_profile in profile_options.values() if "id" in printer_profile], portPreference=connection_options["portPreference"], baudratePreference=connection_options["baudratePreference"], printerProfilePreference=default_profile["id"] if "id" in default_profile else None ) return options
def printerProfilesList(): all_profiles = printerProfileManager.get_all() return jsonify(dict(profiles=_convert_profiles(all_profiles)))
def printerProfilesList(): all_profiles = printerProfileManager.get_all() return jsonify({"profiles": _convert_profiles(all_profiles)})
def printerProfilesList(): all_profiles = printerProfileManager.get_all() return jsonify(dict(profiles=_convert_profiles(all_profiles)))