本文整理汇总了Python中kivy.clock.Clock.unschedule方法的典型用法代码示例。如果您正苦于以下问题:Python Clock.unschedule方法的具体用法?Python Clock.unschedule怎么用?Python Clock.unschedule使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kivy.clock.Clock
的用法示例。
在下文中一共展示了Clock.unschedule方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _update_files
# 需要导入模块: from kivy.clock import Clock [as 别名]
# 或者: from kivy.clock.Clock import unschedule [as 别名]
def _update_files(self, *args, **kwargs):
# trigger to start gathering the files in the new directory
# we'll start a timer that will do the job, 10 times per frames
# (default)
self._gitems = []
self._gitems_parent = kwargs.get('parent', None)
self._gitems_gen = self._generate_file_entries(
path=kwargs.get('path', self.path),
parent=self._gitems_parent)
# cancel any previous clock if exist
Clock.unschedule(self._create_files_entries)
# show the progression screen
self._hide_progress()
if self._create_files_entries():
# not enough for creating all the entries, all a clock to continue
# start a timer for the next 100 ms
Clock.schedule_interval(self._create_files_entries, .1)
示例2: on_touch_up
# 需要导入模块: from kivy.clock import Clock [as 别名]
# 或者: from kivy.clock.Clock import unschedule [as 别名]
def on_touch_up(self, touch):
if self._get_uid('cavoid') in touch.ud:
return
if self in [x() for x in touch.grab_list]:
touch.ungrab(self)
self._touch = None
ud = touch.ud[self._get_uid()]
if ud['mode'] == 'unknown':
Clock.unschedule(self._change_touch_mode)
super(Carousel, self).on_touch_down(touch)
Clock.schedule_once(partial(self._do_touch_up, touch), .1)
else:
self._start_animation()
else:
if self._touch is not touch and self.uid not in touch.ud:
super(Carousel, self).on_touch_up(touch)
return self._get_uid() in touch.ud
示例3: _on_textinput_focused
# 需要导入模块: from kivy.clock import Clock [as 别名]
# 或者: from kivy.clock.Clock import unschedule [as 别名]
def _on_textinput_focused(self, instance, value, *largs):
self.focus = value
win = EventLoop.window
self.cancel_selection()
self._hide_cut_copy_paste(win)
if value:
if (not (self.readonly or self.disabled) or _is_desktop and
self._keyboard_mode == 'system'):
Clock.schedule_interval(self._do_blink_cursor, 1 / 2.)
self._editable = True
else:
self._editable = False
else:
Clock.unschedule(self._do_blink_cursor)
self._hide_handles(win)
示例4: _timer_stop
# 需要导入模块: from kivy.clock import Clock [as 别名]
# 或者: from kivy.clock.Clock import unschedule [as 别名]
def _timer_stop(self):
if self._timer is not None:
Clock.unschedule(self._timer)
self._timer = None
示例5: exit
# 需要导入模块: from kivy.clock import Clock [as 别名]
# 或者: from kivy.clock.Clock import unschedule [as 别名]
def exit(self, dt):
Clock.unschedule(self.exit)
anim = Animation(y = metrics.dp(-50), t = 'in_out_expo')
anim.start(self)
示例6: on_touch_move
# 需要导入模块: from kivy.clock import Clock [as 别名]
# 或者: from kivy.clock.Clock import unschedule [as 别名]
def on_touch_move(self, touch, *args):
if (
touch.ud['menu_timeout'] and
squared_dist(touch.pos, touch.opos) > self.cancel_distance ** 2
):
Clock.unschedule(touch.ud['menu_timeout'])
return super(MenuSpawner, self).on_touch_move(touch, *args)
示例7: on_touch_up
# 需要导入模块: from kivy.clock import Clock [as 别名]
# 或者: from kivy.clock.Clock import unschedule [as 别名]
def on_touch_up(self, touch, *args):
if touch.ud.get('menu_timeout'):
Clock.unschedule(touch.ud['menu_timeout'])
return super(MenuSpawner, self).on_touch_up(touch, *args)
示例8: animated_diff_scale_at
# 需要导入模块: from kivy.clock import Clock [as 别名]
# 或者: from kivy.clock.Clock import unschedule [as 别名]
def animated_diff_scale_at(self, d, x, y):
self._scale_target_time = 1.
self._scale_target_pos = x, y
if self._scale_target_anim == False:
self._scale_target_anim = True
self._scale_target = d
else:
self._scale_target += d
Clock.unschedule(self._animate_scale)
Clock.schedule_interval(self._animate_scale, 1 / 60.)
示例9: trigger_update
# 需要导入模块: from kivy.clock import Clock [as 别名]
# 或者: from kivy.clock.Clock import unschedule [as 别名]
def trigger_update(self, full):
self._need_redraw_full = full or self._need_redraw_full
Clock.unschedule(self.do_update)
Clock.schedule_once(self.do_update, -1)
示例10: on_hover
# 需要导入模块: from kivy.clock import Clock [as 别名]
# 或者: from kivy.clock.Clock import unschedule [as 别名]
def on_hover(self, *a):
if self.hover:
Clock.schedule_once(self.show_label_info,1)
else:
Clock.unschedule(self.show_label_info)
infolabel.remove_info_on_mouse()
示例11: on_touch_move
# 需要导入模块: from kivy.clock import Clock [as 别名]
# 或者: from kivy.clock.Clock import unschedule [as 别名]
def on_touch_move(self, touch, *args):
try:
if (
touch.ud['menu_timeout'] and
dist(touch.pos, touch.opos) > self.cancel_distance
):
Clock.unschedule(touch.ud['menu_timeout'])
except KeyError:
pass
return super(MenuSpawner, self).on_touch_move(touch, *args)
示例12: on_touch_up
# 需要导入模块: from kivy.clock import Clock [as 别名]
# 或者: from kivy.clock.Clock import unschedule [as 别名]
def on_touch_up(self, touch, *args):
if touch.ud.get('menu_timeout'):
Clock.unschedule(touch.ud['menu_timeout'])
return super(MenuSpawner, self).on_touch_up(touch, *args)
示例13: init_osc
# 需要导入模块: from kivy.clock import Clock [as 别名]
# 或者: from kivy.clock.Clock import unschedule [as 别名]
def init_osc(self):
osc.init()
self.oscid = osc.listen(ipAddr='127.0.0.1', port=self.receive_port)
osc.bind(self.oscid, self.receive_osc_message, b'/stdout')
osc.bind(self.oscid, self.receive_osc_message, b'/stderr')
osc.bind(self.oscid, self.receive_osc_message, b'/interpreter')
osc.bind(self.oscid, self.receive_osc_message, b'/pong')
osc.bind(self.oscid, self.receive_osc_message, b'/requestinput')
# def begin_osc_listen(self):
# Clock.schedule_interval(self.read_osc_queue, 0.1)
# def end_osc_listen(self):
# Clock.unschedule(self.read_osc_queue)
示例14: receive_osc_message
# 需要导入模块: from kivy.clock import Clock [as 别名]
# 或者: from kivy.clock.Clock import unschedule [as 别名]
def receive_osc_message(self, message, *args):
print('received message', message, args)
address = message[0]
body = [s.decode('utf-8') for s in message[2:]]
if address == b'/interpreter':
if body[0] == 'completed_exec':
self.dispatch('on_execution_complete')
self.interpreter_state = 'waiting'
self.lock_input = False
# self.end_osc_listen()
elif body[0] == 'received_command':
Clock.unschedule(self.command_not_received)
elif body[0].startswith('omitted'):
number = body[0].split(' ')[-1]
self.dispatch('on_missing_labels', number)
elif address == b'/pong':
self.pong()
elif address == b'/stdout':
self.dispatch('on_stdout', body[0])
elif address == b'/stderr':
self.dispatch('on_stderr', body[0])
elif address == b'/requestinput':
self.dispatch('on_request_input', body[0])
示例15: restart
# 需要导入模块: from kivy.clock import Clock [as 别名]
# 或者: from kivy.clock.Clock import unschedule [as 别名]
def restart(self):
if platform == 'android':
from jnius import autoclass
service = autoclass('{}.Service{}'.format(package_name, self.service_name))
mActivity = autoclass('org.kivy.android.PythonActivity').mActivity
service.stop(mActivity)
self.start_interpreter(self.thread_name)
else:
self.subprocess.kill()
self.start_interpreter(self.thread_name)
self.lock_input = True
self.interpreter_state = 'restarting'
Clock.unschedule
Clock.schedule_interval(self.ping, 0.3)