示例#1
0
    def handle_label(label, i):
        delayer = ops.delay(i * 0.100)
        mapper = ops.map(lambda xy: (label, xy, i))

        return window.mousemove.pipe(
            delayer,
            mapper,
        )
示例#2
0
    def label2stream(
            label: tkinter.Label, index: int
    ) -> Observable[Tuple[tkinter.Label, "Event[Frame]", int]]:

        return mousemoves.pipe(
            ops.map(lambda ev: (label, ev, index)),
            ops.delay(index * 0.1),
        )
示例#3
0
    def _retryable(self, data: str, delay: datetime.timedelta):

        return rx.of(data).pipe(
            ops.delay(duetime=delay, scheduler=self._scheduler),
            ops.map(lambda x: self._http(x)),
            ops.catch(handler=lambda exception, source: self._retry_handler(
                exception, source, data)),
        )
示例#4
0
    def handle_image(i, image):
        imagerect = image.get_rect()

        def on_next(ev):
            imagerect.top = ev[1]
            imagerect.left = ev[0] + i * 32

            if old[i]:
                erase.append(old[i])
            old[i] = imagerect.copy()
            draw.append((image, imagerect.copy()))

        def on_error(err):
            print("Got error: %s" % err)
            sys.exit()

        mousemove.pipe(ops.delay(0.1 * i, scheduler=scheduler)).subscribe(
            on_next, on_error=on_error)
示例#5
0
 async def go():
     nonlocal result
     source = reactivex.return_value(42).pipe(ops.delay(0.1))
     result = await source
示例#6
0
文件: test_delay.py 项目: lizh06/RxPY
 def create():
     return xs.pipe(delay(50))
示例#7
0
文件: test_delay.py 项目: lizh06/RxPY
 def create():
     dt = datetime.utcfromtimestamp(300.0)
     return xs.pipe(delay(dt))
示例#8
0
文件: test_delay.py 项目: lizh06/RxPY
 def create():
     return xs.pipe(delay(100.0))
示例#9
0
文件: test_delay.py 项目: lizh06/RxPY
 def create():
     return xs.pipe(delay(datetime.utcfromtimestamp(350)))