feat: 开发 unifront 前端会话模块
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
|
||||
import heurams.interface.widgets as pzw
|
||||
import heurams.kernel.puzzles as pz
|
||||
import platform, os, sys
|
||||
from heurams.context import config_var
|
||||
|
||||
puzzle2widget = {
|
||||
pz.RecognitionPuzzle: pzw.Recognition,
|
||||
@@ -9,3 +11,13 @@ puzzle2widget = {
|
||||
pz.MCQPuzzle: pzw.MCQPuzzle,
|
||||
pz.BasePuzzle: pzw.BasePuzzleWidget,
|
||||
}
|
||||
|
||||
|
||||
def set_term_title(title):
|
||||
if not config_var.get()['interface']['global']['change_window_title']:
|
||||
return
|
||||
system = platform.system()
|
||||
if system == "Windows":
|
||||
os.system(f"title {title}")
|
||||
else: # Linux, Mac, etc.
|
||||
os.write(2, f"\033]2;{title}\007".encode("utf-8"))
|
||||
|
||||
Reference in New Issue
Block a user