phanterpwa 13.14.11__py3-none-any.whl → 13.15.1__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.
- phanterpwa/__init__.py +1 -1
- phanterpwa/backend/request_handlers/auth.py +35 -6
- phanterpwa/frontend/components/widgets.py +1 -0
- {phanterpwa-13.14.11.dist-info → phanterpwa-13.15.1.dist-info}/METADATA +1 -1
- {phanterpwa-13.14.11.dist-info → phanterpwa-13.15.1.dist-info}/RECORD +10 -10
- {phanterpwa-13.14.11.dist-info → phanterpwa-13.15.1.dist-info}/LICENSE +0 -0
- {phanterpwa-13.14.11.dist-info → phanterpwa-13.15.1.dist-info}/WHEEL +0 -0
- {phanterpwa-13.14.11.dist-info → phanterpwa-13.15.1.dist-info}/dependency_links.txt +0 -0
- {phanterpwa-13.14.11.dist-info → phanterpwa-13.15.1.dist-info}/entry_points.txt +0 -0
- {phanterpwa-13.14.11.dist-info → phanterpwa-13.15.1.dist-info}/top_level.txt +0 -0
phanterpwa/__init__.py
CHANGED
|
@@ -3,6 +3,7 @@ import base64
|
|
|
3
3
|
import json
|
|
4
4
|
import re
|
|
5
5
|
from urllib.request import urlopen
|
|
6
|
+
from pydal import DAL
|
|
6
7
|
from passlib.hash import pbkdf2_sha512
|
|
7
8
|
from phanterpwa.backend.decorators import (
|
|
8
9
|
check_client_token,
|
|
@@ -3380,12 +3381,40 @@ class SMSGateway(web.RequestHandler):
|
|
|
3380
3381
|
|
|
3381
3382
|
|
|
3382
3383
|
class AuthActivityNoRelational():
|
|
3383
|
-
|
|
3384
|
-
|
|
3384
|
+
DALs = {}
|
|
3385
|
+
|
|
3386
|
+
def __init__(self, db_folder, limit_clean=2000):
|
|
3387
|
+
self.db_folder = db_folder
|
|
3385
3388
|
self.limit_clean = limit_clean
|
|
3386
3389
|
|
|
3390
|
+
@classmethod
|
|
3391
|
+
def user_activity_database(cls, id_user, folder):
|
|
3392
|
+
id_user = int(id_user)
|
|
3393
|
+
try:
|
|
3394
|
+
db_user = cls.DALs[id_user]
|
|
3395
|
+
except KeyError:
|
|
3396
|
+
path = os.path.join(folder, "user_{}".format(id_user))
|
|
3397
|
+
if not os.path.exists(path):
|
|
3398
|
+
os.makedirs(path, True)
|
|
3399
|
+
db_user = DAL(
|
|
3400
|
+
'sqlite://activity.sqlite',
|
|
3401
|
+
pool_size=10,
|
|
3402
|
+
folder=path,
|
|
3403
|
+
migrate_enabled=True,
|
|
3404
|
+
check_reserved=['all']
|
|
3405
|
+
)
|
|
3406
|
+
db_user.define_table(
|
|
3407
|
+
'auth_activity_no_relational',
|
|
3408
|
+
Field('id_user', 'integer'),
|
|
3409
|
+
Field('request', 'text'),
|
|
3410
|
+
Field('activity', 'string'),
|
|
3411
|
+
Field('date_activity', 'datetime', default=datetime.now())
|
|
3412
|
+
)
|
|
3413
|
+
cls.DALs[id_user] = db_user
|
|
3414
|
+
return db_user
|
|
3415
|
+
|
|
3387
3416
|
def get_rows_by_user_id(self, id_user, limit=100):
|
|
3388
|
-
db = self.
|
|
3417
|
+
db = self.user_activity_database(id_user, self.db_folder)
|
|
3389
3418
|
return db(
|
|
3390
3419
|
db.auth_activity_no_relational.id_user == int(id_user)
|
|
3391
3420
|
).select(
|
|
@@ -3394,7 +3423,7 @@ class AuthActivityNoRelational():
|
|
|
3394
3423
|
)
|
|
3395
3424
|
|
|
3396
3425
|
def set_activity(self, id_user, request, activity, date_activity=None):
|
|
3397
|
-
db = self.
|
|
3426
|
+
db = self.user_activity_database(id_user, self.db_folder)
|
|
3398
3427
|
if date_activity is None:
|
|
3399
3428
|
date_activity = datetime.now()
|
|
3400
3429
|
db.auth_activity_no_relational.insert(
|
|
@@ -3408,13 +3437,13 @@ class AuthActivityNoRelational():
|
|
|
3408
3437
|
self.clean(id_user)
|
|
3409
3438
|
|
|
3410
3439
|
def get_last_activity(self, id_user):
|
|
3411
|
-
db = self.
|
|
3440
|
+
db = self.user_activity_database(id_user, self.db_folder)
|
|
3412
3441
|
row = db(db.auth_activity_no_relational.id_user == id_user).select(orderby=~db.auth_activity_no_relational.id, limitby=[0, 1]).last()
|
|
3413
3442
|
return row
|
|
3414
3443
|
|
|
3415
3444
|
def clean(self, id_user):
|
|
3416
3445
|
if self.limit_clean:
|
|
3417
|
-
db = self.
|
|
3446
|
+
db = self.user_activity_database(id_user, self.db_folder)
|
|
3418
3447
|
exedent_records = db(
|
|
3419
3448
|
db.auth_activity_no_relational.id_user == int(id_user)
|
|
3420
3449
|
)._select(
|
|
@@ -5987,6 +5987,7 @@ class Button(Widget):
|
|
|
5987
5987
|
|
|
5988
5988
|
def del_disabled(self):
|
|
5989
5989
|
self._disabled = False
|
|
5990
|
+
self._total_click = 0
|
|
5990
5991
|
if self._has_href is None:
|
|
5991
5992
|
jQuery(self.target_selector).removeClass("loading").find("#{0}".format(self._id_button)).removeAttr("disabled", "disabled")
|
|
5992
5993
|
else:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
phanterpwa/__init__.py,sha256
|
|
1
|
+
phanterpwa/__init__.py,sha256=T_iuAetK2HLlSZ2bJs_vUuRVKgtcyNxV_46N-59hIxs,397
|
|
2
2
|
phanterpwa/__main__.py,sha256=1vSHtv6-sgAgpZiklf9bwarXX1b-fmKx1rjwJw4h78o,4017
|
|
3
3
|
phanterpwa/compiler.py,sha256=Je3qtVO_cZ69_PPWcXKyBgnRfQ-Ev-zkZ3UTN-ddOTQ,47478
|
|
4
4
|
phanterpwa/configer.py,sha256=O0IO5rf-hwFNdBjcz94OF-fqXKTWbqPElTsfS5V2beY,26327
|
|
@@ -22,7 +22,7 @@ phanterpwa/backend/pydal/gallery.py,sha256=nETfQ2Dv-0N94Ypq14uGiDKeGlWgxDHLjY4s1
|
|
|
22
22
|
phanterpwa/backend/pydal/internal_messages.py,sha256=DYDNWpjrvAM0Nn4m5fGkJXJsMVQjwuJgcMaRzOEzmE4,1379
|
|
23
23
|
phanterpwa/backend/request_handlers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
24
24
|
phanterpwa/backend/request_handlers/admin.py,sha256=fRiGgc3S-Jo0GSHmpamEunMXT1M8PBUYAb3iCzmVuJw,59688
|
|
25
|
-
phanterpwa/backend/request_handlers/auth.py,sha256=
|
|
25
|
+
phanterpwa/backend/request_handlers/auth.py,sha256=I65UaLn--ijzL0p0mYIIT8OxKDVkD68EdoEpSxw20cw,168630
|
|
26
26
|
phanterpwa/backend/request_handlers/cas.py,sha256=x041v85dklkP9dPmDqZVMHZaBXcTwXU9LWnRDk42pl0,24299
|
|
27
27
|
phanterpwa/backend/request_handlers/credentials.py,sha256=eBa8UAmInI-k7PKXh65XbWe58hCkxrALTqdyGt3GqxI,47702
|
|
28
28
|
phanterpwa/backend/request_handlers/errors.py,sha256=_WG-K1Igh_IVn6t1pEzP7QgpBq_2pP2sGz_jbj3Cth4,3775
|
|
@@ -109,7 +109,7 @@ phanterpwa/frontend/components/modal.py,sha256=q4v2z3HUS58lJ49E6ZWCEkSRVXy7kMiy5
|
|
|
109
109
|
phanterpwa/frontend/components/pagination.py,sha256=IJIyReYbKRj4OTVsZbNiCMfSOIq7qSLpFTF9qQdPbFM,791
|
|
110
110
|
phanterpwa/frontend/components/snippets.py,sha256=fm-QPIJ_Mv8fSHsS3UK8Bq8Iw_ziaECwEr-VjcaiPQw,4060
|
|
111
111
|
phanterpwa/frontend/components/top_slide.py,sha256=ReB0z63I9HjT8iq6ZfNB56KoZLzBxdfcFCIw7QjRQvU,3175
|
|
112
|
-
phanterpwa/frontend/components/widgets.py,sha256=
|
|
112
|
+
phanterpwa/frontend/components/widgets.py,sha256=qPtICSSpoaCL8S2bgQC8Z1RoVea_8EWNi_0bAk2z6zQ,263574
|
|
113
113
|
phanterpwa/frontend/plugins/client.py,sha256=0x1HmGq6-WAap9RGl2szQj1GXClyGVtnznuYMwpUdb8,27481
|
|
114
114
|
phanterpwa/gallery/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
115
115
|
phanterpwa/gallery/cutter.py,sha256=0-VnFa3aQ5XgNmA4P3BsL-_04IwkjrgHImKIrL3qViM,7789
|
|
@@ -435,10 +435,10 @@ phanterpwa/usual_sass/preloaders/indefined_text.sass,sha256=z4JuUtBrzoqH3HuNFXvN
|
|
|
435
435
|
phanterpwa/usual_sass/preloaders/run_points.sass,sha256=EYl93ljfgAc-ZLJ0VScrCoIlHP7Nr6NLdxj1zk2wm_E,3367
|
|
436
436
|
phanterpwa/usual_sass/preloaders/square.sass,sha256=TOsh9muP4zkYLUJcw4i1LeRs60NrtgRWBk_1oMt2_58,1348
|
|
437
437
|
phanterpwa/usual_sass/preloaders/squares.sass,sha256=kH1I89qEfmbvYxCtKFVNcxP5bWIjnqbheXVnyGF0VNo,3862
|
|
438
|
-
phanterpwa-13.
|
|
439
|
-
phanterpwa-13.
|
|
440
|
-
phanterpwa-13.
|
|
441
|
-
phanterpwa-13.
|
|
442
|
-
phanterpwa-13.
|
|
443
|
-
phanterpwa-13.
|
|
444
|
-
phanterpwa-13.
|
|
438
|
+
phanterpwa-13.15.1.dist-info/LICENSE,sha256=lGEW1PRSZOkug2-d0IJgryCjqt6zhxN5x9pFgy3lx2E,1087
|
|
439
|
+
phanterpwa-13.15.1.dist-info/METADATA,sha256=P1jr5U-CYVPVtvEHaZ6M2yf-HWU8UUmmLZJO4u-_l1E,1939
|
|
440
|
+
phanterpwa-13.15.1.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
|
|
441
|
+
phanterpwa-13.15.1.dist-info/dependency_links.txt,sha256=Pslekmz-4l1SpBO0x2aYkYZPCScmbrB9HUq1YvXYUzM,40
|
|
442
|
+
phanterpwa-13.15.1.dist-info/entry_points.txt,sha256=siJH2lFXIdsUBDRgcXV4blOb2_iku1vcbqxJ-trIQrw,56
|
|
443
|
+
phanterpwa-13.15.1.dist-info/top_level.txt,sha256=nF1WJ8AByxBv3bLKp3xySR2l2Twrj5n5n7C404lULSk,5319
|
|
444
|
+
phanterpwa-13.15.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|