Повышена стабильность

This commit is contained in:
Risen 2023-07-13 20:35:03 +03:00
parent 43ce6eaeef
commit d1e2f4ab7e
4 changed files with 5 additions and 4 deletions

View File

@ -19,7 +19,7 @@ _ = lang.gettext
def create_window(): def create_window():
with open('setts.json') as f: with open(os.path.expanduser('setts.json')) as f:
theme = json.load(f)['settings']['theme'] theme = json.load(f)['settings']['theme']
Sgi.theme(theme) Sgi.theme(theme)
menu_def = [ menu_def = [
@ -81,7 +81,7 @@ def main():
Sgi.popup_ok(not_connect) Sgi.popup_ok(not_connect)
elif event == _('Рассчитать'): elif event == _('Рассчитать'):
with open('setts.json') as f: with open(os.path.expanduser('setts.json')) as f:
params = json.load(f)["settings"] params = json.load(f)["settings"]
try: try:
hours = float(values[1]) hours = float(values[1])

View File

@ -8,7 +8,7 @@ from lists import themes_list, lang_list, currency_list
def language(): def language():
with open('setts.json') as file: with open(os.path.expanduser('setts.json')) as file:
old_data = json.load(file) old_data = json.load(file)
if old_data['settings']["locale"] == 'English': if old_data['settings']["locale"] == 'English':
locale = 'en_US' locale = 'en_US'

View File

@ -73,4 +73,4 @@ new_sets = (_('Задайте стоимость принтера, \n'
new_marge = (_('Задайте процент желаемой наценки\n' new_marge = (_('Задайте процент желаемой наценки\n'
'в настройках (можно просто проставить ноль)')) 'в настройках (можно просто проставить ноль)'))
ver = '0.6.1' ver = '0.6.3'

View File

@ -2,6 +2,7 @@ import requests
import webbrowser import webbrowser
import json import json
import PySimpleGUI as Sgi import PySimpleGUI as Sgi
import os
import gettext import gettext
from texts import ver from texts import ver