Python kivy 模块,platform() 实例源码

我们从Python开源项目中,提取了以下3个代码示例,用于说明如何使用kivy.platform()

项目:VKBot    作者:Fogapod    | 项目源码 | 文件源码
def start(self):
        self.logging_function(u'??????? ?????? ????', 1, time.time())
        self.start_reading_osc_queue()

        if platform == 'android':
            # self.subprocess = autoclass(
            #     'org.fogaprod.vkbot.dev.ServiceBotservice')
            # mActivity = autoclass(
            #     'org.kivy.android.PythonActivity').mActivity
            # argument = ''
            # self.subprocess.start(mActivity, argument)
            self.subprocess = AndroidService('VKBot', '??? ????????')
            self.subprocess.start('?????? ???????')
        else:
            self.subprocess = subprocess.Popen(
                ['python2.7', 'service/main.py'])

        self.start_requesting_answers_count()
项目:VKBot    作者:Fogapod    | 项目源码 | 文件源码
def stop(self):
        self.stop_requesting_answers_count()

        if platform == 'android':
            if self.subprocess:
                # self.subprocess = autoclass(
                #     'org.fogaprod.vkbot.dev.ServiceBotservice')
                # mActivity = autoclass(
                #     'org.kivy.android.PythonActivity').mActivity
                # argument = ''
                # self.subprocess.stop(mActivity)
                self.subprocess.stop()
        else:
            osc.sendMsg('/exit', [], port=3000)

            if self.subprocess is not None:
                self.subprocess.kill()

        self.stop_reading_osc_queue()
        self.logging_function(
            u'[b]??? ????????? ??????????[/b]', 2, time.time())
项目:VKBot    作者:Fogapod    | 项目源码 | 文件源码
def _get_ref():
    global _toast
    if _toast is None:
        if platform == 'android':
            from androidtoast import toast
        else:
            from kivytoast import toast

        _toast = toast
    return _toast