yeref 0.29.28__py3-none-any.whl → 0.29.30__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
@@ -7753,13 +7753,14 @@ async def upd_user_data_main(data, web_app_init_data, BASE_P, BOT_TOKEN_E18B, re
|
|
7753
7753
|
page = data.get('page', '')
|
7754
7754
|
connectedAddress = data.get('connectedAddress', '')
|
7755
7755
|
USER_TID = chat_id
|
7756
|
-
USER_HID = USER_LZ = None
|
7756
|
+
USER_HID = USER_LZ = USER_DT = None
|
7757
7757
|
USER_VARS = json.loads(USER_VARS_)
|
7758
7758
|
USER_LSTS = json.loads(USER_LSTS_)
|
7759
7759
|
USER_GAMES = {}
|
7760
7760
|
balls = 1
|
7761
7761
|
is_paid = False
|
7762
7762
|
till_paid = ''
|
7763
|
+
now_ = datetime.now(timezone.utc)
|
7763
7764
|
|
7764
7765
|
print(f"upd_user_data_main: {lc=}, {USER_LSTS=}")
|
7765
7766
|
try:
|
@@ -7793,14 +7794,14 @@ async def upd_user_data_main(data, web_app_init_data, BASE_P, BOT_TOKEN_E18B, re
|
|
7793
7794
|
elif lc in ['ru', 'kz', 'kg', 'uz', 'tm', 'md', 'am', 'uk-UA', 'uk', 'kk', 'tk', 'ky']:
|
7794
7795
|
lz = 'ru'
|
7795
7796
|
USER_LZ = lz
|
7796
|
-
if not
|
7797
|
+
if not USER_DT:
|
7798
|
+
USER_DT = now_
|
7797
7799
|
USER_VARS['USER_DT'] = USER_DT.strftime("%d-%m-%Y_%H-%M-%S")
|
7798
7800
|
USER_HID = hashlib.blake2b(f"{'tid'}-{chat_id}".encode('utf-8'), digest_size=4).hexdigest()
|
7799
7801
|
if utm: USER_VARS['USER_UTM'] = utm
|
7800
7802
|
|
7801
|
-
|
7802
|
-
USER_LSTS["
|
7803
|
-
USER_LSTS["USER_MAU"] = list(set(USER_LSTS.get("USER_MAU", []) + [now.strftime('%Y-%m')]))
|
7803
|
+
USER_LSTS["USER_DAU"] = list(set(USER_LSTS.get("USER_DAU", []) + [now_.strftime('%Y-%m-%d')]))
|
7804
|
+
USER_LSTS["USER_MAU"] = list(set(USER_LSTS.get("USER_MAU", []) + [now_.strftime('%Y-%m')]))
|
7804
7805
|
USER_VARS['USER_SIG'] = usr_sig
|
7805
7806
|
USER_VARS['USER_ISPREMIUM'] = is_premium
|
7806
7807
|
USER_VARS['USER_LZ'] = USER_LZ
|
@@ -7862,9 +7863,9 @@ async def upd_user_data_main(data, web_app_init_data, BASE_P, BOT_TOKEN_E18B, re
|
|
7862
7863
|
sql = f"""
|
7863
7864
|
INSERT INTO \"USER\" (
|
7864
7865
|
USER_TID, USER_HID, USER_USERNAME, USER_FULLNAME, USER_ISPREMIUM,
|
7865
|
-
USER_LZ, USER_GAMES, USER_VARS, USER_LSTS
|
7866
|
+
USER_LZ, USER_DT, USER_GAMES, USER_VARS, USER_LSTS
|
7866
7867
|
)
|
7867
|
-
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9)
|
7868
|
+
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10)
|
7868
7869
|
ON CONFLICT (USER_TID) DO UPDATE
|
7869
7870
|
SET
|
7870
7871
|
USER_HID = EXCLUDED.USER_HID,
|
@@ -7877,7 +7878,7 @@ async def upd_user_data_main(data, web_app_init_data, BASE_P, BOT_TOKEN_E18B, re
|
|
7877
7878
|
USER_VARS = EXCLUDED.USER_VARS,
|
7878
7879
|
USER_LSTS = EXCLUDED.USER_LSTS
|
7879
7880
|
"""
|
7880
|
-
await db_change_pg(sql, (USER_TID, USER_HID, username, full_name, is_premium, USER_LZ,
|
7881
|
+
await db_change_pg(sql, (USER_TID, USER_HID, username, full_name, is_premium, USER_LZ, USER_DT,
|
7881
7882
|
json.dumps(USER_GAMES, ensure_ascii=False),
|
7882
7883
|
json.dumps(USER_VARS, ensure_ascii=False),
|
7883
7884
|
json.dumps(USER_LSTS, ensure_ascii=False),), BASE_P)
|
@@ -7901,11 +7902,12 @@ async def upd_user_data(ENT_TID, data, web_app_init_data, PROJECT_USERNAME, BASE
|
|
7901
7902
|
page = data.get('page', '')
|
7902
7903
|
connectedAddress = data.get('connectedAddress', '')
|
7903
7904
|
USER_TID = chat_id
|
7904
|
-
USER_HID = USER_LZ = None
|
7905
|
+
USER_HID = USER_LZ = USER_DT = None
|
7905
7906
|
USER_VARS = json.loads(USER_VARS_)
|
7906
7907
|
USER_LSTS = json.loads(USER_LSTS_)
|
7907
7908
|
USER_GAMES = {}
|
7908
7909
|
balls = 1
|
7910
|
+
now_ = datetime.now(timezone.utc)
|
7909
7911
|
|
7910
7912
|
print(f"upd_user_data: {USER_LSTS=}")
|
7911
7913
|
try:
|
@@ -7950,13 +7952,15 @@ async def upd_user_data(ENT_TID, data, web_app_init_data, PROJECT_USERNAME, BASE
|
|
7950
7952
|
elif lc in ['ru', 'kz', 'kg', 'uz', 'tm', 'md', 'am', 'uk-UA', 'uk', 'kk', 'tk', 'ky']:
|
7951
7953
|
lz = 'ru'
|
7952
7954
|
USER_LZ = lz
|
7953
|
-
if not
|
7955
|
+
if not USER_DT:
|
7956
|
+
USER_DT = now_
|
7954
7957
|
USER_VARS['USER_DT'] = USER_DT.strftime("%d-%m-%Y_%H-%M-%S")
|
7958
|
+
USER_HID = hashlib.blake2b(f"{'tid'}-{chat_id}".encode('utf-8'), digest_size=4).hexdigest()
|
7959
|
+
if req_url: USER_VARS['USER_UTM'] = req_url
|
7955
7960
|
if not USER_HID: USER_HID = hashlib.blake2b(f"{tid}-{chat_id}".encode('utf-8'), digest_size=4).hexdigest()
|
7956
7961
|
|
7957
|
-
|
7958
|
-
USER_LSTS["
|
7959
|
-
USER_LSTS["USER_MAU"] = list(set(USER_LSTS.get("USER_MAU", []) + [now.strftime('%Y-%m')]))
|
7962
|
+
USER_LSTS["USER_DAU"] = list(set(USER_LSTS.get("USER_DAU", []) + [now_.strftime('%Y-%m-%d')]))
|
7963
|
+
USER_LSTS["USER_MAU"] = list(set(USER_LSTS.get("USER_MAU", []) + [now_.strftime('%Y-%m')]))
|
7960
7964
|
USER_VARS['USER_SIG'] = usr_sig
|
7961
7965
|
USER_VARS['USER_ISPREMIUM'] = is_premium
|
7962
7966
|
USER_VARS['USER_LZ'] = USER_LZ
|
@@ -7988,9 +7992,9 @@ async def upd_user_data(ENT_TID, data, web_app_init_data, PROJECT_USERNAME, BASE
|
|
7988
7992
|
sql = f"""
|
7989
7993
|
INSERT INTO {schema_name}_{tid}.USER (
|
7990
7994
|
USER_TID, USER_HID, USER_USERNAME, USER_FULLNAME, USER_ISPREMIUM,
|
7991
|
-
USER_LZ, USER_GAMES, USER_VARS, USER_LSTS
|
7995
|
+
USER_LZ, USER_DT, USER_GAMES, USER_VARS, USER_LSTS
|
7992
7996
|
)
|
7993
|
-
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9)
|
7997
|
+
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10)
|
7994
7998
|
ON CONFLICT (USER_TID) DO UPDATE
|
7995
7999
|
SET
|
7996
8000
|
USER_HID = EXCLUDED.USER_HID,
|
@@ -8003,7 +8007,7 @@ async def upd_user_data(ENT_TID, data, web_app_init_data, PROJECT_USERNAME, BASE
|
|
8003
8007
|
USER_VARS = EXCLUDED.USER_VARS,
|
8004
8008
|
USER_LSTS = EXCLUDED.USER_LSTS
|
8005
8009
|
"""
|
8006
|
-
await db_change_pg(sql, (USER_TID, USER_HID, username, full_name, is_premium, USER_LZ,
|
8010
|
+
await db_change_pg(sql, (USER_TID, USER_HID, username, full_name, is_premium, USER_LZ, USER_DT,
|
8007
8011
|
json.dumps(USER_GAMES, ensure_ascii=False),
|
8008
8012
|
json.dumps(USER_VARS, ensure_ascii=False),
|
8009
8013
|
json.dumps(USER_LSTS, ensure_ascii=False),), BASE_P)
|
@@ -18886,6 +18890,24 @@ async def set_privacy(app):
|
|
18886
18890
|
|
18887
18891
|
|
18888
18892
|
# region google
|
18893
|
+
async def normalize_rows(rows):
|
18894
|
+
out = []
|
18895
|
+
for row in rows:
|
18896
|
+
new_row = []
|
18897
|
+
iterable = row.values() if hasattr(row, "values") else row
|
18898
|
+
for c in iterable:
|
18899
|
+
if isinstance(c, datetime.datetime):
|
18900
|
+
new_row.append(c.isoformat())
|
18901
|
+
elif isinstance(c, (dict, list)):
|
18902
|
+
new_row.append(json.dumps(c, ensure_ascii=False))
|
18903
|
+
elif c is None:
|
18904
|
+
new_row.append("")
|
18905
|
+
else:
|
18906
|
+
new_row.append(str(c))
|
18907
|
+
out.append(new_row)
|
18908
|
+
return out
|
18909
|
+
|
18910
|
+
|
18889
18911
|
async def api_sync_all(value_many, spreadsheet_id, CONF_P, EXTRA_D, range_many='A2', sheet_id='Sheet1',
|
18890
18912
|
value_input_option='USER_ENTERED', major_dimension="ROWS"):
|
18891
18913
|
scopes = r_conf('scopes', CONF_P)
|
@@ -18894,12 +18916,23 @@ async def api_sync_all(value_many, spreadsheet_id, CONF_P, EXTRA_D, range_many='
|
|
18894
18916
|
http_auth = credentials.authorize(httplib2.Http())
|
18895
18917
|
sheets_service = build('sheets', 'v4', http=http_auth, cache_discovery=False)
|
18896
18918
|
|
18897
|
-
convert_value = []
|
18898
|
-
for item in value_many:
|
18899
|
-
|
18900
|
-
|
18901
|
-
await api_write_cells(sheets_service, convert_value, range_many, spreadsheet_id, sheet_id, value_input_option,
|
18902
|
-
|
18919
|
+
# convert_value = []
|
18920
|
+
# for item in value_many:
|
18921
|
+
# convert_value.append(list(item))
|
18922
|
+
#
|
18923
|
+
# await api_write_cells(sheets_service, convert_value, range_many, spreadsheet_id, sheet_id, value_input_option, major_dimension)
|
18924
|
+
prepared = await normalize_rows([list(item) for item in value_many])
|
18925
|
+
# print(f"{convert_value=}")
|
18926
|
+
|
18927
|
+
await api_write_cells(
|
18928
|
+
sheets_service,
|
18929
|
+
convert_value,
|
18930
|
+
range_many,
|
18931
|
+
spreadsheet_id,
|
18932
|
+
sheet_id,
|
18933
|
+
value_input_option,
|
18934
|
+
major_dimension
|
18935
|
+
)
|
18903
18936
|
|
18904
18937
|
|
18905
18938
|
async def api_sync_update(value_many, spreadsheet_id, range_many, CONF_P, EXTRA_D, sheet_id='Sheet1',
|
@@ -0,0 +1,8 @@
|
|
1
|
+
yeref/__init__.py,sha256=Qpv3o6Xa78VdLcsSRmctGtpnYE9btpAkCekgGhgJyXM,49
|
2
|
+
yeref/l_.py,sha256=RbirKXasMmKTniXrvC08hF2DVfuHg-s75Z8pliEkEZk,616929
|
3
|
+
yeref/tonweb.js,sha256=Jf6aFOQ1OIY4q7fINYz-m5LsI3seMus124M5SYYZmtE,443659
|
4
|
+
yeref/yeref.py,sha256=8jarf3k95P1m1hvljunQDeQPGah3cAXgPlmHr6Bk8j4,1048853
|
5
|
+
yeref-0.29.30.dist-info/METADATA,sha256=vsompAIEKBavM4RrUG5PQjO3R6VG5Hyu_Do-fiFZ26o,119
|
6
|
+
yeref-0.29.30.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
7
|
+
yeref-0.29.30.dist-info/top_level.txt,sha256=yCQKchWHbfV-3OuQPYRdi2loypD-nmbDJbtt3OuKKkY,6
|
8
|
+
yeref-0.29.30.dist-info/RECORD,,
|
yeref-0.29.28.dist-info/RECORD
DELETED
@@ -1,8 +0,0 @@
|
|
1
|
-
yeref/__init__.py,sha256=Qpv3o6Xa78VdLcsSRmctGtpnYE9btpAkCekgGhgJyXM,49
|
2
|
-
yeref/l_.py,sha256=RbirKXasMmKTniXrvC08hF2DVfuHg-s75Z8pliEkEZk,616929
|
3
|
-
yeref/tonweb.js,sha256=Jf6aFOQ1OIY4q7fINYz-m5LsI3seMus124M5SYYZmtE,443659
|
4
|
-
yeref/yeref.py,sha256=X16vitC4FCORsY1XMpH4G17kUqcYLUEVe7cdu0T014s,1047780
|
5
|
-
yeref-0.29.28.dist-info/METADATA,sha256=HNzH9lWEfXvIvWYeKfQ458I2kt-X1tl--E7Ejbytq0I,119
|
6
|
-
yeref-0.29.28.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
7
|
-
yeref-0.29.28.dist-info/top_level.txt,sha256=yCQKchWHbfV-3OuQPYRdi2loypD-nmbDJbtt3OuKKkY,6
|
8
|
-
yeref-0.29.28.dist-info/RECORD,,
|
File without changes
|
File without changes
|