Skip to content

Commit ae33e45

Browse files
committed
add status_settings
1 parent 1afbcb9 commit ae33e45

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

mytonctrl/mytonctrl.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ def inject_globals(func):
7070
console.AddItem("installer", inject_globals(Installer), local.translate("installer_cmd"))
7171
console.AddItem("status", inject_globals(PrintStatus), local.translate("status_cmd"))
7272
console.AddItem("status_modes", inject_globals(mode_status), local.translate("status_modes_cmd"))
73+
console.AddItem("status_settings", inject_globals(settings_status), local.translate("settings_status_cmd"))
7374
console.AddItem("enable_mode", inject_globals(enable_mode), local.translate("enable_mode_cmd"))
7475
console.AddItem("disable_mode", inject_globals(disable_mode), local.translate("disable_mode_cmd"))
7576
console.AddItem("about", inject_globals(about), local.translate("about_cmd"))
@@ -458,6 +459,17 @@ def mode_status(ton, args):
458459
#end define
459460

460461

462+
def settings_status(ton, args):
463+
from modules import SETTINGS
464+
color_print(f'''{{cyan}}===[ SETTINGS ]==={{endc}}''')
465+
table = [["Name", "Description", "Mode", "Default value", "Current value"]]
466+
for name, setting in SETTINGS.items():
467+
current_value = ton.local.db.get(name)
468+
table.append([name, setting.description, setting.mode, setting.default_value, current_value])
469+
print_table(table)
470+
#end define
471+
472+
461473
def PrintStatus(local, ton, args):
462474
opt = None
463475
if len(args) == 1:

mytonctrl/resources/translate.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@
1919
"ru": "Показать режимы MTC",
2020
"zh_TW": "顯示 MTC 模式"
2121
},
22+
"settings_status_cmd": {
23+
"en": "Show all available settings with their description and values",
24+
"ru": "Показать все доступные настройки с их описанием и значениями",
25+
"zh_TW": "顯示所有可用設定及其描述和值"
26+
},
2227
"about_cmd": {
2328
"en": "Mode description",
2429
"ru": "Описание режима",

0 commit comments

Comments
 (0)