Skip to content

Commit e960f1f

Browse files
authored
Add files via upload
1 parent 830afdf commit e960f1f

15 files changed

Lines changed: 1592 additions & 178 deletions

File tree

PowerSetSetup-Beta/PowerSetSetup.py

Lines changed: 41 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import sys
1+
import sys
22
import subprocess
33
import os
44
import json
@@ -14,7 +14,7 @@
1414
sleep = time.sleep
1515

1616
Name_Program = "PowerSetSetup"
17-
version = "Dev 1.0.2"
17+
version = "1.0.2-beta+build.1"
1818

1919
LOG_DIR = "logs"
2020
LOG_FILE = os.path.join(LOG_DIR, "logs.txt")
@@ -44,11 +44,12 @@ def clear():
4444

4545
init(autoreset=True)
4646

47-
# Перевод
47+
# Локализация
4848
LOCALE_DIR = 'data/config/locale'
4949
DOMAIN = 'messages'
5050

5151
_ = None
52+
current_lang = 'en'
5253

5354
def get_system_lang():
5455
try:
@@ -84,8 +85,8 @@ def read_config():
8485
"auto_language": True,
8586
"allow_beta": False,
8687
"auto_download_install": False,
87-
"auto_download_install": False,
8888
"version": "1.0.2 beta",
89+
"build": 1,
8990
"last_modified": datetime.now().strftime("%Y-%m-%d %H:%M:%S"),
9091
"description": "settings for PowerSetSetup"
9192
}
@@ -121,12 +122,17 @@ def save_config(config):
121122
return False
122123

123124
def setup_localization(lang_code):
124-
global _
125+
global _, current_lang
125126
try:
126-
translation = gettext.translation(DOMAIN, LOCALE_DIR, languages=[lang_code], fallback=True)
127+
normalized_lang = (lang_code or "en").lower()[:2]
128+
current_lang = normalized_lang
129+
if normalized_lang == "en":
130+
translation = gettext.NullTranslations()
131+
else:
132+
translation = gettext.translation(DOMAIN, LOCALE_DIR, languages=[normalized_lang], fallback=True)
127133
translation.install()
128134
_ = translation.gettext
129-
logging.info(f"The language is set: {lang_code}")
135+
logging.info(f"The language is set: {normalized_lang}")
130136
except Exception as e:
131137
logging.error(f"Error when setting the language: {lang_code}: {e}")
132138
_ = gettext.gettext
@@ -155,8 +161,6 @@ def language_setting(new_lang):
155161
setup_localization(new_lang)
156162

157163
config = apply_language_from_config()
158-
current_lang = config.get("language", "en")
159-
setup_localization(current_lang)
160164

161165
id_power_sh_send = ""
162166

@@ -278,7 +282,7 @@ def update_text_variables():
278282
lang_back_select_delet_scheme = _("Go back to select which scheme to delete?")
279283
lang_settings_succesfull = _("Changes saved!")
280284
lang_successfully = _("Operation completed successfully!")
281-
lang_enter_timeout_minutes = _("Set the display turn‑off time: ")
285+
lang_enter_timeout_minutes = _("Set the display turn‑off time:")
282286
lang_minutes = _("minutes")
283287
lang_settings_menu_scheme = _("Advanced scheme settings")
284288
lang_settings_timeout_monitor = _("Display off time")
@@ -360,6 +364,8 @@ def update_text_variables():
360364
log_add_sh = _("The scheme was successfully added:")
361365
log_error_add_sh = _("Couldn't add schema:")
362366

367+
# это нормально если они помечаются красным цветом ↑
368+
363369
# update text
364370
update_text_variables()
365371

@@ -416,7 +422,7 @@ def manual_check_update():
416422
base_path = os.path.dirname(sys.executable)
417423
exe_path = os.path.join(base_path, "check_update.exe")
418424
if not os.path.exists(exe_path):
419-
print(f"{Fore_RED}{lang_error_file_not_found}: {exe_path}")
425+
print(f"{Fore.RED}Error: {exe_path}") # {lang_error_file_not_found}
420426
os.system("pause")
421427
main_menu()
422428
else:
@@ -450,15 +456,15 @@ def main_menu():
450456
advancedSettings()
451457
break
452458
elif main_menu == "3":
453-
logging.info(_("Manual update check via main menu"))
459+
logging.info(_("Manual update check via main menu")) # временно
454460
manual_check_update()
455461
break
456462
elif main_menu == "4":
457-
logging.info(_("Developer support via main menu"))
463+
logging.info(_("Developer support via main menu")) # временно
458464
support_developer()
459465
break
460466
elif main_menu == "5":
461-
logging.info(_("Go to settings via main menu"))
467+
logging.info(_("Go to settings via main menu")) # временно
462468
settings_menu()
463469
break
464470
elif main_menu in ["9", "6", "back", "b"]:
@@ -494,7 +500,7 @@ def advancedSettings():
494500
while True:
495501
clear()
496502
powercfg_list()
497-
print('\nРасширенные параметры')
503+
print('\nРасширенные параметры электропитания')
498504
print(f'\n1. {lang_delete_scheme}')
499505
print(f'2. {lang_reset_scheme}')
500506
print(f'3. {lang_add_scheme}')
@@ -509,15 +515,15 @@ def advancedSettings():
509515
delete_scheme()
510516
break
511517
elif advancedSettings == "2":
512-
logging.info('Переход в функциию сброса схем через расширенные настройки')
518+
logging.info('Переход в функцию сброса схем через расширенные настройки')
513519
reset_scheme()
514520
break
515521
elif advancedSettings == "3":
516522
logging.info('Переход в добавление схем через расширенные настройки')
517523
add_scheme()
518524
break
519525
elif advancedSettings == "4":
520-
logging.info('Переход в активирование схем через расширенные настройки')
526+
logging.info('Переход в активацию схем через расширенные настройки')
521527
activate_scheme()
522528
break
523529
elif advancedSettings == "5":
@@ -1023,7 +1029,7 @@ def support_developer():
10231029
elif current_lang == "en":
10241030
url = "https://badgen.net/badge/%D1%81%D1%81%D1%8B%D0%BB%D0%BA%D0%B0/%D0%B2%20%D1%80%D0%B0%D0%B7%D1%80%D0%B0%D0%B1%D0%BE%D1%82%D0%BA%D0%B5/red"
10251031
else:
1026-
url = "для вас нет ссылки"
1032+
url = "для вас нет ссылки, потому что ваша система не поддерживается для этой функции!"
10271033
open_url_support_developer(url)
10281034

10291035
def open_url_support_developer(url):
@@ -1033,7 +1039,7 @@ def open_url_support_developer(url):
10331039
try:
10341040
webbrowser.open(url)
10351041
logging.info(f'Ссылка поддержки автора открыта: {url}')
1036-
print(f'Cсылка открыта, если вам удобен другой сервис, то нажмите 2')
1042+
print(f'Ссылка открыта, если вам удобно другой сервис, то нажмите 2')
10371043
except Exception as e:
10381044
logging.error(f"Не удалось открыть ссылку, ошибка {e}")
10391045
print(f"Не удалось открыть ссылку, ошибка {e}")
@@ -1066,8 +1072,8 @@ def settings_menu():
10661072
elif settings_menu == "2":
10671073
clear()
10681074
logging.error("Эта функция недоступна, потому что может навредить вашему компьютеру! Она не готова!")
1069-
print("ERROR: It is beta test!!!")
1070-
print("Ошибка: Это тестовая версия!!!")
1075+
print(f"{Fore.RED}ERROR: It is beta test!!!")
1076+
print(f"{Fore.RED}Ошибка: Это тестовая версия!!!")
10711077
sleep(2)
10721078
elif settings_menu in ["3", "beta"]:
10731079
beta_settings()
@@ -1096,26 +1102,27 @@ def setting_menu_scheme():
10961102
print(f"\n1. {lang_settings_timeout_monitor}")
10971103
print("2.", lang_settings_time_sleep)
10981104
print("3.", lang_settings_timeout_disk)
1099-
print("4.", lang_settings_hibernate)
1100-
print("5.", lang_send_othet) # /A = Отчет о доступных в системе состояниях спящего режима.
1101-
print("6.", lang_next)
1105+
# print("4.", lang_settings_hibernate)
1106+
# print("5.", lang_send_othet) # /A = Отчет о доступных в системе состояниях спящего режима.
1107+
# print("6.", lang_next)
11021108

11031109
def setting_menu_scheme_page2():
11041110
while True:
11051111
clear()
11061112
print(f"{lang_settings_menu_scheme}\n")
11071113
print(lang_config_power_plan)
11081114
powercfg_geta_sh()
1109-
print(f"\n1. {lang_}")
1110-
print("2.", lang_)
1111-
print("3.", lang_battery_report) # /BATTERYREPORT
1112-
print("4.", lang_settings_hibernate) # powercfg /systempowerreport
1113-
print("5.", lang_send_othet) # /A = Отчет о доступных в системе состояниях спящего режима.
1114-
print("6.", lang_next)
1115+
# print(f"\n1. {lang_}")
1116+
# print("2.", lang_)
1117+
# print("3.", lang_battery_report) # /BATTERYREPORT
1118+
# print("4.", lang_settings_hibernate) # powercfg /systempowerreport
1119+
# print("5.", lang_send_othet) # /A = Отчет о доступных в системе состояниях спящего режима.
1120+
# print("6.", lang_next)
11151121

11161122

11171123

11181124
def language_settings():
1125+
global current_lang
11191126
logging.debug("Переход в меню настроек выбора языка")
11201127
while True:
11211128
clear()
@@ -1247,7 +1254,7 @@ def automode_menu():
12471254
automode3()
12481255
break
12491256
elif automode in ["9", "4", "back", "b"]:
1250-
logging.info("Возврат в главное меню")
1257+
logging.info("Переход в главное меню")
12511258
main_menu()
12521259
break
12531260
elif automode in ["0", "5", "exit", "end", "e"]:
@@ -1259,7 +1266,7 @@ def automode_menu():
12591266
sleep(1)
12601267

12611268
def automode1():
1262-
logging.info("Настройка максимальной производительности")
1269+
logging.info("Переход в меню настройки максимальной производительности")
12631270
clear()
12641271
print(".")
12651272

@@ -1318,7 +1325,7 @@ def automode1_end_menu():
13181325
sleep(1)
13191326

13201327
def automode2():
1321-
logging.info("Настройка сбалансированного режима")
1328+
logging.info("Переход в меню настройки сбалансированного режима")
13221329
clear()
13231330
print(".")
13241331

@@ -1374,7 +1381,7 @@ def automode2_end_menu():
13741381
sleep(1)
13751382

13761383
def automode3():
1377-
logging.info("Настройка режима энергосбережения")
1384+
logging.info("Переход в меню настройки режима энергосбережения")
13781385
clear()
13791386
print(".")
13801387

PowerSetSetup-Beta/README_en.txt

Lines changed: 66 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,67 @@
1-
PowerSetSetup ⚡
2-
3-
📖 Description
4-
PowerSetSetup is a powerful Windows utility designed to manage power settings on Windows 10 and Windows 11 operating systems. With an intuitive interface, you can easily perform various operations with power schemes including:
5-
6-
- 🔄 Activating power schemes
7-
- 🗑️ Deleting unwanted power plans
8-
- ➕ Adding custom power schemes
9-
- 🔄 Resetting to default settings
10-
- 🔍 Retrieving power scheme IDs
11-
- ⚙️ Optimizing power consumption
12-
13-
Copyright © 2025 BrocatScript. All rights reserved.
14-
15-
🚀 Installation
16-
1. ▶ Download PowerSetSetup_installer.exe
17-
2. 📁 Select your preferred installation path
18-
3. ⏳ Wait for the installation to complete
19-
4. ✅ Launch and configure your power settings
20-
21-
⚠️ Important Notes
22-
| Warning | Description |
23-
|---------|-------------|
24-
| 🔄 | Create a system restore point before making changes |
25-
| 💻 | Close resource-intensive applications** during installation |
26-
| 🪟 | Requires Windows 10/11 - not compatible with older versions |
27-
| 🛡️ | Temporarily disable third-party antiviruses if installation fails |
28-
29-
📜 License
30-
🔒 Proprietary Software - Usage Restrictions:
31-
32-
❌ PROHIBITED:
33-
- Selling the program, modifications, or derivative works
34-
- Distributing modified versions
35-
- Removing or altering copyright notices
36-
- Presenting as your own development
37-
38-
✅ ALLOWED:
39-
- Free use for personal and commercial purposes
40-
- Distribution of original, unmodified versions
41-
- Use in companies and organizations
42-
- Modification for personal use
43-
44-
Full license: https://github.com/BrocatScript/PowerSetSetup/blob/main/LICENSE.md
45-
46-
47-
🛠️ Technical Support
48-
Troubleshooting Steps:
49-
1. 🛡️ Disable third-party antivirus software temporarily
50-
2. 🎮 Close all resource-intensive programs
51-
3. 📧 Contact support if issues persist: brocatscript@yandex.com
52-
53-
📬 Contact the Author:
54-
Email: brocatscript@yandex.com
55-
56-
💝 Support the Author
57-
If you find this tool useful, consider supporting the development:
58-
Support: https://pay.cloudtips.ru/p/0cdee068
59-
60-
📞 Contact
61-
For questions, suggestions, or collaboration:
62-
Email: brocatscript@yandex.com
63-
64-
65-
Made with ❤️ by BrocatScript
66-
1+
PowerSetSetup ⚡
2+
3+
📖 Description
4+
PowerSetSetup is a powerful Windows utility designed to manage power settings on Windows 10 and Windows 11 operating systems. With an intuitive interface, you can easily perform various operations with power schemes including:
5+
6+
- 🔄 Activating power schemes
7+
- 🗑️ Deleting unwanted power plans
8+
- ➕ Adding custom power schemes
9+
- 🔄 Resetting to default settings
10+
- 🔍 Retrieving power scheme IDs
11+
- ⚙️ Optimizing power consumption
12+
13+
Copyright © 2025-2026 BrocatScript. All rights reserved.
14+
15+
🚀 Installation
16+
1. ▶ Download PowerSetSetup_installer.exe
17+
2. 📁 Select your preferred installation path
18+
3. ⏳ Wait for the installation to complete
19+
4. ✅ Launch and configure your power settings
20+
21+
⚠️ Important Notes
22+
| Warning | Description |
23+
|---------|-------------|
24+
| 🔄 | Create a system restore point before making changes |
25+
| 💻 | Close resource-intensive applications** during installation |
26+
| 🪟 | Requires Windows 10/11 - not compatible with older versions |
27+
| 🛡️ | Temporarily disable third-party antiviruses if installation fails |
28+
29+
📜 License
30+
🔒 Proprietary Software - Usage Restrictions:
31+
32+
❌ PROHIBITED:
33+
- Selling the program, modifications, or derivative works
34+
- Distributing modified versions
35+
- Removing or altering copyright notices
36+
- Presenting as your own development
37+
38+
✅ ALLOWED:
39+
- Free use for personal and commercial purposes
40+
- Distribution of original, unmodified versions
41+
- Use in companies and organizations
42+
- Modification for personal use
43+
44+
Full license: https://github.com/BrocatScript/PowerSetSetup/blob/main/LICENSE.md
45+
46+
47+
🛠️ Technical Support
48+
Troubleshooting Steps:
49+
1. 🛡️ Disable third-party antivirus software temporarily
50+
2. 🎮 Close all resource-intensive programs
51+
3. 📧 Contact support if issues persist: brocatscript@yandex.com
52+
53+
📬 Contact the Author:
54+
Email: brocatscript@yandex.com
55+
56+
💝 Support the Author
57+
If you find this tool useful, consider supporting the development:
58+
Support: https://pay.cloudtips.ru/p/0cdee068
59+
60+
📞 Contact
61+
For questions, suggestions, or collaboration:
62+
Email: brocatscript@yandex.com
63+
64+
65+
Made with ❤️ by BrocatScript
66+
6767
Optimize your Windows power management experience

0 commit comments

Comments
 (0)