import Pyro4 from Pyro4.naming import type_meta from resources import LaserPrinter, MatrixPrinter, PhotoPrinter, TapeStorage, DiskStorage, Telephone, Faxmachine # register various objects with some metadata describing their resource class ns = Pyro4.locateNS() d = Pyro4.Daemon() uri = d.register(LaserPrinter) ns.register("example.resource.laserprinter", uri, metadata=type_meta(LaserPrinter) | {"resource:printer", "performance:fast"}) uri = d.register(MatrixPrinter) ns.register("example.resource.matrixprinter", uri, metadata=type_meta(MatrixPrinter) | {"resource:printer", "performance:slow"}) uri = d.register(PhotoPrinter) ns.register("example.resource.photoprinter", uri, metadata=type_meta(PhotoPrinter) | {"resource:printer", "performance:slow"}) uri = d.register(TapeStorage) ns.register("example.resource.tapestorage", uri, metadata=type_meta(TapeStorage) | {"resource:storage", "performance:slow"}) uri = d.register(DiskStorage) ns.register("example.resource.diskstorage", uri, metadata=type_meta(DiskStorage) | {"resource:storage", "performance:fast"}) uri = d.register(Telephone) ns.register("example.resource.telephone", uri, metadata=type_meta(Telephone) | {"resource:communication"}) uri = d.register(Faxmachine) ns.register("example.resource.faxmachine", uri, metadata=type_meta(Faxmachine) | {"resource:communication"})
import Pyro4 from Pyro4.naming import type_meta from resources import LaserPrinter, MatrixPrinter, PhotoPrinter, TapeStorage, DiskStorage, Telephone, Faxmachine # register various objects with some metadata describing their resource class ns = Pyro4.locateNS() d = Pyro4.Daemon() uri = d.register(LaserPrinter) ns.register("example.resource.laserprinter", uri, metadata=type_meta(LaserPrinter) | {"resource:printer", "performance:fast"}) uri = d.register(MatrixPrinter) ns.register("example.resource.matrixprinter", uri, metadata=type_meta(MatrixPrinter) | {"resource:printer", "performance:slow"}) uri = d.register(PhotoPrinter) ns.register("example.resource.photoprinter", uri, metadata=type_meta(PhotoPrinter) | {"resource:printer", "performance:slow"}) uri = d.register(TapeStorage) ns.register("example.resource.tapestorage", uri, metadata=type_meta(TapeStorage) | {"resource:storage", "performance:slow"}) uri = d.register(DiskStorage) ns.register("example.resource.diskstorage", uri,
import Pyro4 from Pyro4.naming import type_meta from resources import LaserPrinter, MatrixPrinter, PhotoPrinter, TapeStorage, DiskStorage # register various objects with some metadata describing their resource class ns = Pyro4.locateNS() d = Pyro4.Daemon() uri = d.register(LaserPrinter) ns.register( "example.resource.laserprinter", uri, metadata=type_meta(LaserPrinter) | {"resource:printer", "performance:fast"} ) uri = d.register(MatrixPrinter) ns.register( "example.resource.matrixprinter", uri, metadata=type_meta(MatrixPrinter) | {"resource:printer", "performance:slow"} ) uri = d.register(PhotoPrinter) ns.register( "example.resource.photoprinter", uri, metadata=type_meta(PhotoPrinter) | {"resource:printer", "performance:slow"} ) uri = d.register(TapeStorage) ns.register( "example.resource.tapestorage", uri, metadata=type_meta(TapeStorage) | {"resource:storage", "performance:slow"} ) uri = d.register(DiskStorage) ns.register( "example.resource.diskstorage", uri, metadata=type_meta(DiskStorage) | {"resource:storage", "performance:fast"} )