python类platform()的实例源码

oscclient.py 文件源码 项目:VKBot 作者: Fogapod 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
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()
oscclient.py 文件源码 项目:VKBot 作者: Fogapod 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
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())
__init__.py 文件源码 项目:VKBot 作者: Fogapod 项目源码 文件源码 阅读 59 收藏 0 点赞 0 评论 0
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


问题


面经


文章

微信
公众号

扫码关注公众号