self.bli = False def func1(self): return "executed func1" def func2(self, v): return 2 * v def func3(self, a, b, c=1, d=3): """Just some documentation""" return "done func3" def func(self, nap_time): import time time.sleep(nap_time) return "Finished sleep for {0}s".format(nap_time) server = Server("many", server_type="Server") N = 100 objs = [] for i in range(N): name = "obj%04d" % i obj = MyClass() objs.append(obj) server.register_object(obj, name) server.run()
self.ble = 11 self.bli = False def func1(self): return "executed func1" def func2(self, v): return 2*v def func3(self, a, b, c=1, d=3): """Just some documentation""" return "done func3" def func(self, nap_time): import time time.sleep(nap_time) return "Finished sleep for {0}s".format(nap_time) server = Server("many", server_type="Server") N = 100 objs = [] for i in range(N): name = "obj%04d" % i obj = MyClass() objs.append(obj) server.register_object(obj, name) server.run()
return "done func3" class AnotherClass: def __init__(self, valid=True): self.__valid = valid def is_valid(self): return self.__valid def lets_go(self, p1): return "lets_go done!", p1 def fft(self, a, n=None, axis=-1): import numpy.fft return numpy.fft.fft(a, n=n, axis=axis) def array(self, a): return a my_object = MyClass() another_object = AnotherClass(valid=False) server = Server("multi", server_type="Server") server.register_object(my_object, "multi_my_object") server.register_object(another_object, "multi_another_object") server.run()
def func1(self): return "executed func1" def func2(self, v): return 2 * v def func3(self, a, b, c=1, d=3): """Just some documentation""" return "done func3" def add_roi(self, name, roi): self.__rois[name] = roi server.register_object(roi, name) def remove_roi(self, name): del self.__rois[name] # no need to unregister object import logging logging.basicConfig(level=logging.DEBUG) my_object = MyClass() a_roi = ROI(0, 0, 0, 0) server = Server("Dynamic") server.register_object(my_object, "dynamic_object") server.register_object(a_roi, "dummy_roi") server.run()
def func2(self, v): return 2 * v def func3(self, a, b, c=1, d=3): """Just some documentation""" return "done func3" def func4(self): roi1 = ROI(10, 20, 640, 480) roi2 = ROI(0, 0, 1024, 768) return roi1.__dict__ def zeros(self, shape, dtype='float'): import numpy return numpy.zeros(shape, dtype=dtype) def func5(self, nap_time): import time time.sleep(nap_time) return "Finished sleep for {0}s".format(nap_time) my_object = MyClass() server = Server("Bla") server.register_object(my_object, "my_object") server.run()
def func1(self): return "executed func1" def func2(self, v): return 2*v def func3(self, a, b, c=1, d=3): """Just some documentation""" return "done func3" def add_roi(self, name, roi): self.__rois[name] = roi server.register_object(roi, name) def remove_roi(self, name): del self.__rois[name] # no need to unregister object import logging logging.basicConfig(level=logging.DEBUG) my_object = MyClass() a_roi = ROI(0,0,0,0) server = Server("Dynamic") server.register_object(my_object, "dynamic_object") server.register_object(a_roi, "dummy_roi") server.run()
def func2(self, v): return 2*v def func3(self, a, b, c=1, d=3): """Just some documentation""" return "done func3" def func4(self): roi1 = ROI(10, 20, 640, 480) roi2 = ROI(0, 0, 1024, 768) return roi1.__dict__ def zeros(self, shape, dtype='float'): import numpy return numpy.zeros(shape, dtype=dtype) def func5(self, nap_time): import time time.sleep(nap_time) return "Finished sleep for {0}s".format(nap_time) my_object = MyClass() server = Server("Bla") server.register_object(my_object, "my_object") server.run()