From 02a04af2586e0b542944f5f2aedfde25938ff8e5 Mon Sep 17 00:00:00 2001 From: Risen Date: Thu, 13 Jul 2023 22:01:06 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20?= =?UTF-8?q?=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA=D1=83=20=D1=84=D0=B0?= =?UTF-8?q?=D0=B9=D0=BB=D0=B0=20=D0=BD=D0=B0=D1=81=D1=82=D1=80=D0=BE=D0=B5?= =?UTF-8?q?=D0=BA.=20=D0=9F=D1=80=D0=BE=D0=B3=D1=80=D0=B0=D0=BC=D0=BC?= =?UTF-8?q?=D0=B0=20=D0=BD=D0=B5=20=D0=BA=D1=80=D0=B0=D1=88=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=D1=81=D1=8F,=20=D0=B5=D1=81=D0=BB=D0=B8=20=D0=B2=20?= =?UTF-8?q?=D0=BD=D0=B0=D1=81=D1=82=D1=80=D0=BE=D0=B9=D0=BA=D0=B0=D1=85=20?= =?UTF-8?q?=D0=BD=D0=B5=D1=82=20=D0=BF=D1=83=D0=BD=D0=BA=D1=82=D0=B0=20"?= =?UTF-8?q?=D0=B2=D0=B0=D0=BB=D1=8E=D1=82=D0=B0"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- requirements.txt | Bin 596 -> 0 bytes setts.py | 24 +++++++++++++++++------- 2 files changed, 17 insertions(+), 7 deletions(-) delete mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 595a6ae8d028a6e9d1791db785937c2f3bc1604c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 596 zcmZvZQBQ+F5QOL1#GgV_pryX}Y@qphM5U1Mgbq zovotm+<6OXNWDQtvb3%uE8i-!az@QFnKhNYy2>8N$W_bp;!HXhUjsf#bkqp;B6c*r zCU?g#I{BYVIF+93o%so8(NiffzrpTL#i;VcYFkDRoTn;1;2Do5<-G88V~?tLva_6S z<7AdtyZ`H$>ITy4b~33qQirkT$omf*9St*~Xy)!RD<0{&^-Jvd0;-mpD7dHd)T5h; a9oJ?>sZwEu^E|xmd&i diff --git a/setts.py b/setts.py index 5f87d9a..e389deb 100644 --- a/setts.py +++ b/setts.py @@ -25,12 +25,19 @@ _ = lang.gettext def currency_setts(): with open('setts.json') as file: old_data = json.load(file) - if old_data['settings']["currency"] == 'руб.': - currency = 'руб.' - elif old_data['settings']["currency"] == '$': - currency = '$' - else: - currency = '€' + try: + if old_data['settings']["currency"] == 'руб.': + currency = 'руб.' + elif old_data['settings']["currency"] == '$': + currency = '$' + else: + currency = '€' + + except KeyError: + if old_data['settings']["locale"] == "рус.": + currency = 'руб.' + else: + currency = '$' return currency @@ -45,7 +52,10 @@ def window_setts(): mk = old_data["settings"]["mk"] a = old_data["settings"]["a"] locale = old_data['settings']["locale"] - currency = old_data['settings']["currency"] + try: + currency = old_data['settings']["currency"] + except KeyError: + currency = "руб." try: spi = old_data["settings"]["spi"] except KeyError: