python类unschedule()的实例源码

screens.py 文件源码 项目:Mobile-TetriNET 作者: Smug28 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def prev(self, *args):
        self.root.sm.transition = SlideTransition(direction="right")
        self.root.sm.current = 'TutorialNavigate'
        Clock.unschedule(self.nextFrame)
screens.py 文件源码 项目:Mobile-TetriNET 作者: Smug28 项目源码 文件源码 阅读 31 收藏 0 点赞 0 评论 0
def nextScreen(self, *args):
        self.root.sm.transition = SlideTransition(direction="left")
        self.root.sm.current = 'MainMenuScreen'
        Clock.unschedule(self.nextFrame)
view.py 文件源码 项目:HAB2017 作者: LBCC-SpaceClub 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
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.)
view.py 文件源码 项目:HAB2017 作者: LBCC-SpaceClub 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
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)
__init__.py 文件源码 项目:garden.animlabel 作者: kivy-garden 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def animate(self):
        if self.target_text:
            self._time = 0
            Clock.unschedule(self.tick)
            Clock.schedule_interval(self.tick, 0)
thermostat.py 文件源码 项目:thermostat_ita 作者: jpnos26 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def check_pir( pin ):
    global minUITimer
    global lightOffTimer
    with thermostatLock:
        if GPIO.input( pirPin ): 
            log( LOG_LEVEL_INFO, CHILD_DEVICE_PIR, MSG_SUBTYPE_TRIPPED, "1" )

            if minUITimer != None:
                  Clock.unschedule( show_minimal_ui )
                  if lightOffTimer != None:
                    Clock.unschedule( light_off )   
            minUITimer = Clock.schedule_once( show_minimal_ui, minUITimeout ) 
            lighOffTimer = Clock.schedule_once( light_off, lightOff )   
            ignore = False
            now = datetime.datetime.now().time()

            if pirIgnoreFrom > pirIgnoreTo:
                if now >= pirIgnoreFrom or now < pirIgnoreTo:
                    ignore = True
            else:
                if now >= pirIgnoreFrom and now < pirIgnoreTo:
                    ignore = True

            if screenMgr.current == "minimalUI" and not( ignore ):
                screenMgr.current = "thermostatUI"
                log( LOG_LEVEL_DEBUG, CHILD_DEVICE_SCREEN, MSG_SUBTYPE_TEXT, "Full" )

        else:
            log( LOG_LEVEL_DEBUG, CHILD_DEVICE_PIR, MSG_SUBTYPE_TRIPPED, "0" )

# connect with oregon scientific and check inside outside temperature
logviewer.py 文件源码 项目:mobileinsight-mobile 作者: mobile-insight 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def load(self, path, filename, *args):
        load_failed_popup = Popup(
            title='Error while opening file', content=Label(
                text='Please select a valid file'), size_hint=(
                0.8, 0.2))
        if filename == []:
            self.dismiss_open_popup()
            load_failed_popup.open()
        else:
            name, extension = os.path.splitext(filename[0])
            if extension == [u'.mi2log'][0]:
                self.loading_num = 2
                self.loading_popup = Popup(
                    title='',
                    content=Label(
                        text='Loading.',
                        font_size=self.width / 25),
                    size_hint=(
                        0.3,
                        0.2),
                    separator_height=0,
                    title_size=0)
                self.loading_popup.open()
                Clock.schedule_interval(self.loading, 1)
                Clock.unschedule(self.check_scroll_limit)
                self.grid.clear_widgets()
                with open(os.path.join(path, filename[0])) as stream:
                    t = Thread(
                        target=self.openFile,
                        args=(
                            os.path.join(
                                path,
                                filename[0]),
                            self.selectedTypes))
                    t.start()
                    self.dismiss_open_popup()
            else:
                self.dismiss_open_popup()
                load_failed_popup.open()
logviewer.py 文件源码 项目:mobileinsight-mobile 作者: mobile-insight 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def search_ok(self, *args):
        if self.loaded == 'Yes':
            self.data_view = [
                x for x in self.data_view if self.search_textinput.text in x["Payload"]]
            self.SetUpGrid(self.data_view, len(self.data_view), 'init')
            self.dismiss_search_popup()
            Clock.unschedule(self.check_scroll_limit)
            Clock.schedule_interval(self.check_scroll_limit, 0.11)
        else:
            self.dismiss_search_popup()


# Reset
# Reset the grid to the state before filtering and/or searching
logviewer.py 文件源码 项目:mobileinsight-mobile 作者: mobile-insight 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def onReset(self):
        if self.loaded == 'Yes':
            self.data_view = self.data
            self.SetUpGrid(self.data_view, len(self.data_view), 'init')
            Clock.unschedule(self.check_scroll_limit)
            Clock.schedule_interval(self.check_scroll_limit, 0.11)


# Go To
# Go to the selected row
logviewer.py 文件源码 项目:mobileinsight-mobile 作者: mobile-insight 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def goto_ok(self, *args):
        rows = len(self.data_view)
        num = self.goto_textinput.text
        if num.isdigit():
            if int(num) > 0 and rows >= int(num):
                if int(num) >= rows - 12:
                    self.k = rows
                    self.dismiss_goto_popup()
                    self.SetUpGrid(self.data, len(self.data), 'over')
                else:
                    self.k = int(num) - 1
                    self.dismiss_goto_popup()
                    if self.k >= rows - 24:
                        self.SetUpGrid(self.data, len(self.data), '')
                    else:
                        self.SetUpGrid(self.data, len(self.data), 'up!')
                Clock.unschedule(self.check_scroll_limit)
                Clock.schedule_interval(self.check_scroll_limit, 0.11)
            else:
                self.dismiss_goto_popup()
                goto_failed_popup = Popup(
                    title='Error', content=Label(
                        text='Please write an integer in the given range'), size_hint=(
                        0.8, 0.2))
                goto_failed_popup.open()
        else:
            self.dismiss_goto_popup()
            goto_failed_popup = Popup(
                title='Error', content=Label(
                    text='Please write an integer in the given range'), size_hint=(
                    0.8, 0.2))
            goto_failed_popup.open()
view.py 文件源码 项目:mobileinsight-mobile 作者: mobile-insight 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
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)
mazegenerator.py 文件源码 项目:MazeGenerator 作者: MazeFX 项目源码 文件源码 阅读 34 收藏 0 点赞 0 评论 0
def start(self, button):
        if button == 'back':
            self.started = True
        if not self.started:
            self.started = True
            Clock.schedule_interval(self.my_callback, ANIMSPEED)
            self.running.text = 'Stop'
        else:
            Clock.unschedule(self.my_callback)
            self.started = False
            self.running.text = 'Start'
thermostat.py 文件源码 项目:RaspberryPiThermostat 作者: scottpav 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def check_pir( pin ):
    global minUITimer

    with thermostatLock:
        if GPIO.input( pirPin ): 
            log( LOG_LEVEL_INFO, CHILD_DEVICE_PIR, MSG_SUBTYPE_TRIPPED, "1" )

            if minUITimer != None:
                  Clock.unschedule( show_minimal_ui )

            minUITimer = Clock.schedule_once( show_minimal_ui, minUITimeout ) 

            ignore = False
            now = datetime.datetime.now().time()

            if pirIgnoreFrom > pirIgnoreTo:
                if now >= pirIgnoreFrom or now < pirIgnoreTo:
                    ignore = True
            else:
                if now >= pirIgnoreFrom and now < pirIgnoreTo:
                    ignore = True

            if screenMgr.current == "minimalUI" and not( ignore ):
                screenMgr.current = "thermostatUI"
                log( LOG_LEVEL_DEBUG, CHILD_DEVICE_SCREEN, MSG_SUBTYPE_TEXT, "Full" )

        else:
            log( LOG_LEVEL_DEBUG, CHILD_DEVICE_PIR, MSG_SUBTYPE_TRIPPED, "0" )


# Minimal UI Display functions and classes
printerstatus.py 文件源码 项目:SuperOcto 作者: mcecchi 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def safety(self,dt):
        self.safety_counter += 1
        safety_time = 60

        if self.safety_counter == safety_time and self.startup == False:
            self.detirmine_layout()
            self.check_updates()
            Clock.schedule_interval(self.update_clock, 3600)
            Clock.unschedule(self.splash_event)
            return False
        elif self.safety_counter == safety_time and self.startup == True:
            return False
printerstatus.py 文件源码 项目:RoboLCD 作者: victorevector 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def safety(self,dt):
        self.safety_counter += 1
        safety_time = 60

        if self.safety_counter == safety_time and self.startup == False:
            self.detirmine_layout()
            self.check_updates()
            Clock.schedule_interval(self.update_clock, 3600)
            Clock.unschedule(self.splash_event)
            return False
        elif self.safety_counter == safety_time and self.startup == True:
            return False
toast.py 文件源码 项目:kivy_gosh 作者: mcroni 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def exit(self, dt):
        Clock.unschedule(self.exit)
        anim = Animation(y = metrics.dp(-50), t = 'in_out_expo')
        anim.start(self)
program.py 文件源码 项目:DemoKivyContacts 作者: HeaTTheatR 项目源码 文件源码 阅读 28 收藏 0 点赞 0 评论 0
def load_contacts(self, interval):
        if not self.dialog_load_contact:
            self.dialog_load_contact = dialog(
                title=data.string_lang_wait[:-3],
                text=data.string_lang_contacts_load, dismiss=False
            )

        while _default_time() < (Clock.get_time() + MAX_TIME):    
            self.show_contacts(self.info_contacts)
            self.dialog_load_contact.dismiss()
            Clock.unschedule(self.load_contacts)
widget.py 文件源码 项目:segreto-3 作者: anselm94 项目源码 文件源码 阅读 28 收藏 0 点赞 0 评论 0
def exit(self, dt):
        Clock.unschedule(self.exit)
        anim = Animation(y = metrics.dp(-50), t = 'in_out_expo')
        anim.start(self)
quickfind.py 文件源码 项目:mmplayer 作者: Bakterija 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def do_quickfind(self, _, text):
        Clock.unschedule(self._reset_quickfind_text)
        text = self._quickfind_text + text
        self._quickfind_text = text
        result = self.find_index_by_text(self.quickfind_key, text, match=True)
        index = None
        selectable = False
        data_text = ''

        if result:
            index = result[0]
            selectable = True
            data = self.data[index]
            data_text = data[self.quickfind_key]
            if 'selectable' in data and not data['selectable']:
                selectable = False

            if selectable:
                self.scroll_to_index(index)
                delayed = lambda dt: self.children[0].select_with_touch(index)
                Clock.schedule_once(delayed, 0)
        if not selectable:
            self.children[0].deselect_all()

        Logger.info(
            ('AppRecycleViewQuickFind: do_quickfind: '
             'text="{}" index="{}" selectable="{}" data_text={}').format(
                 text, index, selectable, data_text))
        Clock.schedule_once(
            self._reset_quickfind_text, self.quickfind_reset_time)
t_app.py 文件源码 项目:mmplayer 作者: Bakterija 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def kb_esc(self):
        '''Updates self.escape_presses, quits app when reached target value'''
        cfocus = focus.current_focus
        if cfocus:
            focus.remove_focus()
        else:
            if self.escape_presses == 1:
                self.stop()
            else:
                self.display_info_toast('Double press escape to quit')
                self.escape_presses += 1
                Clock.unschedule(self.reset_escape_presses)
                Clock.schedule_once(self.reset_escape_presses, 0.8)


问题


面经


文章

微信
公众号

扫码关注公众号