yeref 0.25.25__py3-none-any.whl → 0.25.27__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
yeref/yeref.py CHANGED
@@ -4020,6 +4020,36 @@ async def check_schema_exists(schema_name, db_pool):
4020
4020
  return result
4021
4021
 
4022
4022
 
4023
+ async def not_del_if_payments(chat_id, status, MEDIA_D, BASE_P):
4024
+ try:
4025
+ sql = "SELECT USER_VARS, USER_LSTS FROM \"USER\" WHERE USER_TID=$1"
4026
+ data_users = await db_select_pg(sql, (chat_id,), BASE_P)
4027
+ if not len(data_users): return
4028
+ print(f"{data_users=}")
4029
+ USER_VARS, USER_LSTS = data_users[0]
4030
+
4031
+ USER_LSTS = json.loads(USER_LSTS or USER_LSTS_)
4032
+ USER_TXS = USER_LSTS.get("USER_TXS", [])
4033
+ USER_PAYMENTS = USER_LSTS.get("USER_PAYMENTS", [])
4034
+ USER_STATUSES = USER_LSTS.get("USER_STATUSES", [])
4035
+
4036
+ if len(USER_TXS) or len(USER_PAYMENTS):
4037
+ dt_ = datetime.now(timezone.utc).strftime('%d-%m-%Y_%H-%M-%S')
4038
+ USER_STATUSES.append({status: dt_})
4039
+ USER_LSTS["USER_STATUSES"] = USER_STATUSES
4040
+ USER_LSTS = json.dumps(USER_LSTS, ensure_ascii=False)
4041
+
4042
+ sql = "UPDATE \"USER\" SET USER_LSTS=$1 WHERE USER_TID=$2"
4043
+ await db_change_pg(sql, (USER_LSTS, chat_id,), BASE_P)
4044
+ elif status in ['left', 'kicked']:
4045
+ sql = "DELETE FROM \"USER\" WHERE USER_TID=$1"
4046
+ await db_change_pg(sql, (chat_id,), BASE_P)
4047
+ print("DELETE FROM \"USER\" WHERE USER_TID=$1")
4048
+
4049
+ shutil.rmtree(os.path.join(MEDIA_D, str(chat_id)))
4050
+ except Exception as e:
4051
+ logger.info(log_ % str(e))
4052
+ await asyncio.sleep(round(random.uniform(0, 1), 2))
4023
4053
  # endregion
4024
4054
 
4025
4055
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: yeref
3
- Version: 0.25.25
3
+ Version: 0.25.27
4
4
  Summary: desc-f
5
5
  Author: john smith
6
6
  Dynamic: author
@@ -0,0 +1,8 @@
1
+ yeref/__init__.py,sha256=Qpv3o6Xa78VdLcsSRmctGtpnYE9btpAkCekgGhgJyXM,49
2
+ yeref/l_.py,sha256=LsciHUN0b5NbsLsRRbG12blZGXVr_i4Fhj2aQItIZbI,1173447
3
+ yeref/tonweb.js,sha256=Jf6aFOQ1OIY4q7fINYz-m5LsI3seMus124M5SYYZmtE,443659
4
+ yeref/yeref.py,sha256=NALWROeiPWh88ViOJiX5celO5AOJ0TgE-SyBD5eD5CU,1024334
5
+ yeref-0.25.27.dist-info/METADATA,sha256=FN7tmzLTePBe89OSbMw5hB0hOG-n5tKNyzPuSNiPbEA,119
6
+ yeref-0.25.27.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
7
+ yeref-0.25.27.dist-info/top_level.txt,sha256=yCQKchWHbfV-3OuQPYRdi2loypD-nmbDJbtt3OuKKkY,6
8
+ yeref-0.25.27.dist-info/RECORD,,
@@ -1,8 +0,0 @@
1
- yeref/__init__.py,sha256=Qpv3o6Xa78VdLcsSRmctGtpnYE9btpAkCekgGhgJyXM,49
2
- yeref/l_.py,sha256=LsciHUN0b5NbsLsRRbG12blZGXVr_i4Fhj2aQItIZbI,1173447
3
- yeref/tonweb.js,sha256=Jf6aFOQ1OIY4q7fINYz-m5LsI3seMus124M5SYYZmtE,443659
4
- yeref/yeref.py,sha256=535y-Gxl0sIXiQI5usvZCFOglwDUzX11B-2zkgDFHsk,1022947
5
- yeref-0.25.25.dist-info/METADATA,sha256=I9EdC61TWL5CJGwV4BNTPFYZl0YZPYRNTzGA85JvPUM,119
6
- yeref-0.25.25.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
7
- yeref-0.25.25.dist-info/top_level.txt,sha256=yCQKchWHbfV-3OuQPYRdi2loypD-nmbDJbtt3OuKKkY,6
8
- yeref-0.25.25.dist-info/RECORD,,