Ejemplo n.º 1
0
 def get_printers(self):
     """Called by a worker subprocess when it creates a new
     PrintServer instance."""
     printers = []
     for namespace in list_printers():
         printers.append(namespace.split(".")[-1][1:].replace("_", "-"))
     return dbus.Array(printers)
Ejemplo n.º 2
0
 def get_printers(self):
     """Called by a worker subprocess when it creates a new
     PrintServer instance."""
     printers = []
     for namespace in list_printers():
         printers.append(namespace.split(".")[-1][1:].replace("_", "-"))
     return dbus.Array(printers)
Ejemplo n.º 3
0
def get_printers():
    bus = get_bus()
    printers = {}
    for namespace in _common.list_printers():
        printer_uuid = uuid.UUID(namespace.split(".")[-1][1:].replace("_", "-"))
        object_path = "/" + namespace.replace(".", "/")
        proxy = bus.get_object(namespace, object_path)
        printers[printer_uuid] = PrinterInterface(printer_uuid, proxy)
    return printers
Ejemplo n.º 4
0
def get_printers():
    bus = get_bus()
    printers = {}
    for namespace in _common.list_printers():
        printer_uuid = uuid.UUID(
            namespace.split(".")[-1][1:].replace("_", "-"))
        object_path = "/" + namespace.replace(".", "/")
        proxy = bus.get_object(namespace, object_path)
        printers[printer_uuid] = PrinterInterface(printer_uuid, proxy)
    return printers
Ejemplo n.º 5
0
def on_disconnect(handler, *event_args):
    """Worker subprocess to handle on_disconnect events generated by
    hardware monitors."""

    bus = common.get_bus()

    for name in list_printers():
        path = "/org/voxelpress/hardware/"+name.split(".")[-1]    
        prox = bus.get_object(name, path)
        if prox.verify_disconnect(event_args[0]):
            break
Ejemplo n.º 6
0
def on_disconnect(handler, *event_args):
    """Worker subprocess to handle on_disconnect events generated by
    hardware monitors."""

    bus = common.get_bus()

    for name in list_printers():
        path = "/org/voxelpress/hardware/" + name.split(".")[-1]
        prox = bus.get_object(name, path)
        if prox.verify_disconnect(event_args[0]):
            break