當前位置: 首頁>>代碼示例>>Python>>正文


Python AppHelper.stopEventLoop方法代碼示例

本文整理匯總了Python中PyObjCTools.AppHelper.stopEventLoop方法的典型用法代碼示例。如果您正苦於以下問題:Python AppHelper.stopEventLoop方法的具體用法?Python AppHelper.stopEventLoop怎麽用?Python AppHelper.stopEventLoop使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PyObjCTools.AppHelper的用法示例。


在下文中一共展示了AppHelper.stopEventLoop方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: _runMainRunLoop

# 需要導入模塊: from PyObjCTools import AppHelper [as 別名]
# 或者: from PyObjCTools.AppHelper import stopEventLoop [as 別名]
def _runMainRunLoop(self):
        # Create background thread to run user code.
        self._user_thread = threading.Thread(target=self._user_thread_main)
        self._user_thread.daemon = True
        self._user_thread.start()
        # Run main loop.  This call will never return!
        try:
            AppHelper.runConsoleEventLoop(installInterrupt=True)
        except KeyboardInterrupt:
            AppHelper.stopEventLoop()
            sys.exit(0) 
開發者ID:thorrak,項目名稱:fermentrack,代碼行數:13,代碼來源:tilt_monitor_macos.py

示例2: run_mainloop_with

# 需要導入模塊: from PyObjCTools import AppHelper [as 別名]
# 或者: from PyObjCTools.AppHelper import stopEventLoop [as 別名]
def run_mainloop_with(self, target):
        """Start the OS's main loop to process asyncronous BLE events and then
        run the specified target function in a background thread.  Target
        function should be a function that takes no parameters and optionally
        return an integer response code.  When the target function stops
        executing or returns with value then the main loop will be stopped and
        the program will exit with the returned code.

        Note that an OS main loop is required to process asyncronous BLE events
        and this function is provided as a convenience for writing simple tools
        and scripts that don't need to be full-blown GUI applications.  If you
        are writing a GUI application that has a main loop (a GTK glib main loop
        on Linux, or a Cocoa main loop on OSX) then you don't need to call this
        function.
        """
        # Create background thread to run user code.
        self._user_thread = threading.Thread(target=self._user_thread_main,
                                             args=(target,))
        self._user_thread.daemon = True
        self._user_thread.start()
        # Run main loop.  This call will never return!
        try:
            AppHelper.runConsoleEventLoop(installInterrupt=True)
        except KeyboardInterrupt:
            AppHelper.stopEventLoop()
            sys.exit(0) 
開發者ID:adafruit,項目名稱:Adafruit_Python_BluefruitLE,代碼行數:28,代碼來源:provider.py

示例3: endLoop

# 需要導入模塊: from PyObjCTools import AppHelper [as 別名]
# 或者: from PyObjCTools.AppHelper import stopEventLoop [as 別名]
def endLoop(self):
        AppHelper.stopEventLoop() 
開發者ID:nateshmbhat,項目名稱:pyttsx3,代碼行數:4,代碼來源:nsss.py

示例4: about

# 需要導入模塊: from PyObjCTools import AppHelper [as 別名]
# 或者: from PyObjCTools.AppHelper import stopEventLoop [as 別名]
def about(self, sender):
        #rumps.alert("My quit message")
        self.apiServer.shutdown()
        AppHelper.stopEventLoop()
        print "after stop"
        
    
    #@rumps.clicked("Arbitrary", "Depth", "It's pretty easy")  # very simple to access nested menu items
    #def does_something(self, sender):
    #    my_data = {'poop': 88}
    #    rumps.notification(title='Hi', subtitle='There.', message='Friend!',  data=my_data)
    
    
    #@rumps.clicked("Preferences")
    #def not_actually_prefs(self, sender):
    #    if not sender.icon:
    #        sender.icon = 'level_4.png'
    #    sender.state = not sender.state
    
    
    #@rumps.timer(4)  # create a new thread that calls the decorated function every 4 seconds
    #def write_unix_time(self, sender):
    #    with self.rumps_app.open('times', 'a') as f:  # this opens files in your app's Application Support folder
    #        f.write('The unix time now: {}\n'.format(time.time()))
    
    
    #@rumps.clicked("Arbitrary")
    #def change_statusbar_title(self, sender):
    #    app.title = 'Hello World' if self.rumps_app.title != 'Hello World' else 'World, Hello' 
開發者ID:beville,項目名稱:ComicStreamer,代碼行數:31,代碼來源:gui_mac.py

示例5: centralManager_didDisconnectPeripheral_error_

# 需要導入模塊: from PyObjCTools import AppHelper [as 別名]
# 或者: from PyObjCTools.AppHelper import stopEventLoop [as 別名]
def centralManager_didDisconnectPeripheral_error_(self, manager, peripheral, error):
        log.debug("centralManager_didDisconnectPeripheral_error_")
        self.connected = False
        #AppHelper.stopEventLoop() 
開發者ID:TheCellule,項目名稱:python-bleson,代碼行數:6,代碼來源:macos_adapter.py


注:本文中的PyObjCTools.AppHelper.stopEventLoop方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。