main.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:KivyCleanMasterDemo 作者: HeaTTheatR 项目源码 文件源码
def main():
    app = None

    try:
        from program import Program  # ???????? ????? ?????????

        # ?????? ??????????.
        app = Program()
        app.run()
    except Exception as exc:
        print(traceback.format_exc())
        traceback.print_exc(file=open("{}/error.log".format(
            os.path.split(os.path.abspath(sys.argv[0]))[0]), "w"))

        if app:  # ??????? ????? ?????????? ?? ???? ????????
            app.start_screen.clear_widgets()

        class Error(App):
            """??????? ????? ? ??????? ??????."""

            def callback_report(self, *args):
                """??????? ???????? ???-???????"""

                try:
                    import webbrowser
                    import six.moves.urllib

                    txt = six.moves.urllib.parse.quote(
                        self.win_report.txt_traceback.text.encode(
                            "utf-8"))
                    url = "https://github.com/HeaTTheatR/KivyCleanMasterDemo" \
                          "/issues/new?body=" + txt
                    webbrowser.open(url)
                except Exception:
                    sys.exit(1)

            def build(self):
                self.win_report = BugReporter(
                    callback_report=self.callback_report, txt_report=str(exc),
                    icon_background="Data/Images/logo.png")
                return self.win_report

        Error().run()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号