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)
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
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
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
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