Ejemplo n.º 1
0
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
Ejemplo n.º 2
0
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
Ejemplo n.º 3
0
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
Ejemplo n.º 4
0
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
Ejemplo n.º 5
0
def printerProfilesList():
	all_profiles = printerProfileManager.get_all()
	return jsonify(dict(profiles=_convert_profiles(all_profiles)))
Ejemplo n.º 6
0
def printerProfilesList():
    all_profiles = printerProfileManager.get_all()
    return jsonify({"profiles": _convert_profiles(all_profiles)})
Ejemplo n.º 7
0
def printerProfilesList():
	all_profiles = printerProfileManager.get_all()
	return jsonify(dict(profiles=_convert_profiles(all_profiles)))