当前位置: 首页>>代码示例>>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;未经允许,请勿转载。