-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(module): 更改进度条计数模式,增加异常报告模块 (#12)
* add(module): add skipper module * fix(module): move skip task out to skipper module * fix(docs): remove an entry of FAQ * fix(module): add function description * fix(module): add progress bar * fix(module): get code formatted * fix(module): change constant source * fix(module): remove unused imports * fix(module): add current task indicator * fix(module): change indicator bar from time-based to counter-based * fix(module): remove unused function, add exception handler * add(module): add exception handler * fix(module): fix wrong increment position of self.current * fix(module): reduce imports * fix(module): reduce imports * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix(module): optimize code format Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
b5fd9f9
commit b2b1b43
Showing
3 changed files
with
83 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
import traceback | ||
import ttkbootstrap as ttk | ||
|
||
|
||
class exceptionHandler(ttk.Toplevel): | ||
def __init__(self, master, e: Exception) -> None: | ||
super().__init__() | ||
self.master = master | ||
self.exception = e | ||
self.stacktrace = "".join(traceback.format_tb(e.__traceback__)) | ||
font = ("Consolas", 10, "normal") | ||
|
||
self.title("啊哦,好像出错了") | ||
self.resizable(False, False) | ||
# self.geometry("500x600") | ||
|
||
self.label1 = ttk.Label( | ||
master=self, anchor=ttk.W, font=font, text="程序运行过程中出现了错误,下面是错误信息。" | ||
) | ||
self.label2 = ttk.Label( | ||
master=self, | ||
anchor=ttk.W, | ||
font=font, | ||
text="麻烦你把下列错误信息发送到 github.com/Fatpandac/fuck_cqooc/issues。" | ||
+ "我们很快就会修复的!", | ||
) | ||
self.label1.pack(fill=ttk.BOTH, padx=10, pady=(10, 0)) | ||
self.label2.pack(fill=ttk.BOTH, padx=10, pady=(0, 10)) | ||
|
||
self.stacktraceText = ttk.Text(master=self, wrap=ttk.WORD) | ||
self.stacktraceText.insert( | ||
ttk.END, | ||
"请将本段信息发送到github.com/Fatpandac/fuck_cqooc/issues," | ||
+ "使用快捷键Ctrl+A和Ctrl+C复制。\n", | ||
) | ||
self.stacktraceText.insert( | ||
ttk.END, "===============================================\n" | ||
) | ||
self.stacktraceText.insert(ttk.END, self.stacktrace) | ||
self.stacktraceText.config(state=ttk.DISABLED, font=font) | ||
self.stacktraceText.pack() | ||
|
||
def start(self) -> None: | ||
self.mainloop() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters