示例#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)
示例#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)
示例#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
示例#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
示例#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
示例#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