PKDevTools 0.13.20250208.215__tar.gz → 0.13.20250208.217__tar.gz
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.
- {pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools/classes/DBManager.py +87 -0
- {pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools/classes/Telegram.py +13 -5
- pkdevtools-0.13.20250208.217/PKDevTools/classes/__init__.py +1 -0
- {pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools.egg-info/PKG-INFO +2 -2
- {pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKG-INFO +2 -2
- pkdevtools-0.13.20250208.215/PKDevTools/classes/__init__.py +0 -1
- {pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/LICENSE +0 -0
- {pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools/LICENSE.txt +0 -0
- {pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools/README.txt +0 -0
- {pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools/__init__.py +0 -0
- {pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools/classes/Archiver.py +0 -0
- {pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools/classes/ColorText.py +0 -0
- {pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools/classes/Committer.py +0 -0
- {pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools/classes/CookieHelper.py +0 -0
- {pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools/classes/Environment.py +0 -0
- {pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools/classes/Fetcher.py +0 -0
- {pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools/classes/FunctionTimeouts.py +0 -0
- {pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools/classes/GmailReader.py +0 -0
- {pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools/classes/MarketHours.py +0 -0
- {pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools/classes/MenuOptions.py +0 -0
- {pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools/classes/NSEMarketStatus.py +0 -0
- {pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools/classes/OutputControls.py +0 -0
- {pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools/classes/PKDateUtilities.py +0 -0
- {pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools/classes/PKGitFolderDownloader.py +0 -0
- {pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools/classes/PKJoinableQueue.py +0 -0
- {pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools/classes/PKMultiProcessorClient.py +0 -0
- {pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools/classes/PKPickler.py +0 -0
- {pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools/classes/PKTimer.py +0 -0
- {pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools/classes/Pikey.py +0 -0
- {pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools/classes/Singleton.py +0 -0
- {pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools/classes/SuppressOutput.py +0 -0
- {pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools/classes/System.py +0 -0
- {pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools/classes/UserSubscriptions.py +0 -0
- {pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools/classes/Utils.py +0 -0
- {pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools/classes/WorkflowManager.py +0 -0
- {pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools/classes/githubutilities.py +0 -0
- {pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools/classes/log.py +0 -0
- {pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools/classes/multiprocessing_logging.py +0 -0
- {pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools/classes/squash.py +0 -0
- {pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools/classes/updater.py +0 -0
- {pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools/release.md +0 -0
- {pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools/requirements.txt +0 -0
- {pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools.egg-info/SOURCES.txt +0 -0
- {pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools.egg-info/dependency_links.txt +0 -0
- {pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools.egg-info/entry_points.txt +0 -0
- {pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools.egg-info/not-zip-safe +0 -0
- {pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools.egg-info/requires.txt +0 -0
- {pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools.egg-info/top_level.txt +0 -0
- {pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/README.md +0 -0
- {pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/setup.cfg +0 -0
- {pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/setup.py +0 -0
{pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools/classes/DBManager.py
RENAMED
@@ -45,6 +45,21 @@ class PKUserModel(Enum):
|
|
45
45
|
subscriptionmodel = 7
|
46
46
|
lastotp = 8
|
47
47
|
|
48
|
+
class PKScannerJob:
|
49
|
+
scannerId=''
|
50
|
+
userIds=[]
|
51
|
+
|
52
|
+
def scannerJobFromRecord(row):
|
53
|
+
scanner = PKScannerJob()
|
54
|
+
scanner.scannerId= row[0]
|
55
|
+
scanner.userIds = []
|
56
|
+
for user in row[1].split(";"):
|
57
|
+
scanner.userIds.append(user)
|
58
|
+
if len(scanner.userIds) > 0:
|
59
|
+
# Only unique values
|
60
|
+
scanner.userIds = list(set(scanner.userIds))
|
61
|
+
return scanner
|
62
|
+
|
48
63
|
class PKUser:
|
49
64
|
userid=0
|
50
65
|
username=""
|
@@ -55,6 +70,8 @@ class PKUser:
|
|
55
70
|
totptoken=""
|
56
71
|
subscriptionmodel=""
|
57
72
|
lastotp=""
|
73
|
+
balance = 0
|
74
|
+
scannerJobs = []
|
58
75
|
|
59
76
|
def userFromDBRecord(row):
|
60
77
|
user = PKUser()
|
@@ -68,6 +85,18 @@ class PKUser:
|
|
68
85
|
user.subscriptionmodel= row[7]
|
69
86
|
user.lastotp= row[8]
|
70
87
|
return user
|
88
|
+
|
89
|
+
def userFromAlertsRecord(row):
|
90
|
+
user = PKUser()
|
91
|
+
user.userid= row[0]
|
92
|
+
user.balance= row[1]
|
93
|
+
user.scannerJobs = []
|
94
|
+
for job in row[2].split(";"):
|
95
|
+
user.scannerJobs.append(str(job).upper())
|
96
|
+
if len(user.scannerJobs) > 0:
|
97
|
+
# Only unique values
|
98
|
+
user.scannerJobs = list(set(user.scannerJobs))
|
99
|
+
return user
|
71
100
|
|
72
101
|
class DBManager:
|
73
102
|
|
@@ -323,3 +352,61 @@ class DBManager:
|
|
323
352
|
self.conn.close()
|
324
353
|
self.conn = None
|
325
354
|
return users
|
355
|
+
|
356
|
+
def alertsForUser(self,userID:int):
|
357
|
+
try:
|
358
|
+
users = []
|
359
|
+
cursor = self.connection()
|
360
|
+
records = cursor.execute(f"SELECT * FROM alertsubscriptions where userId={self.sanitisedIntValue(userID)}")
|
361
|
+
for row in records.rows:
|
362
|
+
users.append(PKUser.userFromAlertsRecord(row))
|
363
|
+
# cursor.close()
|
364
|
+
if len(records.columns) > 0 and len(records.rows) <= 0:
|
365
|
+
default_logger().debug(f"Users not found!")
|
366
|
+
except Exception as e: # pragma: no cover
|
367
|
+
print(f"Could not get alertsForUser\n{e}")
|
368
|
+
default_logger().debug(e, exc_info=True)
|
369
|
+
pass
|
370
|
+
finally:
|
371
|
+
if self.conn is not None:
|
372
|
+
self.conn.close()
|
373
|
+
self.conn = None
|
374
|
+
return users[0] if len(users) > 0 else None
|
375
|
+
|
376
|
+
def scannerJobsWithActiveUsers(self):
|
377
|
+
try:
|
378
|
+
scanners = []
|
379
|
+
cursor = self.connection()
|
380
|
+
records = cursor.execute(f"SELECT * FROM scannerjobs where users != ''")
|
381
|
+
for row in records.rows:
|
382
|
+
scanners.append(PKScannerJob.scannerJobFromRecord(row))
|
383
|
+
if len(records.columns) > 0 and len(records.rows) <= 0:
|
384
|
+
default_logger().debug(f"Scanners not found!")
|
385
|
+
except Exception as e: # pragma: no cover
|
386
|
+
print(f"Could not get scannerJobsWithActiveUsers\n{e}")
|
387
|
+
default_logger().debug(e, exc_info=True)
|
388
|
+
pass
|
389
|
+
finally:
|
390
|
+
if self.conn is not None:
|
391
|
+
self.conn.close()
|
392
|
+
self.conn = None
|
393
|
+
return scanners
|
394
|
+
|
395
|
+
def usersForScannerJobId(self,scannerJobId:str):
|
396
|
+
try:
|
397
|
+
scanners = []
|
398
|
+
cursor = self.connection()
|
399
|
+
records = cursor.execute(f"SELECT * FROM scannerjobs where scannerId = {self.sanitisedStrValue(str(scannerJobId).upper())}")
|
400
|
+
for row in records.rows:
|
401
|
+
scanners.append(PKScannerJob.scannerJobFromRecord(row))
|
402
|
+
if len(records.columns) > 0 and len(records.rows) <= 0:
|
403
|
+
default_logger().debug(f"Scanners not found!")
|
404
|
+
except Exception as e: # pragma: no cover
|
405
|
+
print(f"Could not get scannerJobsWithActiveUsers\n{e}")
|
406
|
+
default_logger().debug(e, exc_info=True)
|
407
|
+
pass
|
408
|
+
finally:
|
409
|
+
if self.conn is not None:
|
410
|
+
self.conn.close()
|
411
|
+
self.conn = None
|
412
|
+
return scanners[0].userIds if len(scanners) > 0 else []
|
{pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools/classes/Telegram.py
RENAMED
@@ -187,12 +187,20 @@ def send_message(message, userID=None, parse_type="HTML", list_png=None, retrial
|
|
187
187
|
if list_png is None or any(elem is None for elem in list_png):
|
188
188
|
resp = None
|
189
189
|
for people_id in LIST_PEOPLE_IDS_CHAT:
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
190
|
+
if len(reply_markup_encoded) > 0:
|
191
|
+
url = (
|
192
|
+
botsUrl
|
193
|
+
+ "/sendMessage?chat_id={}&text={}&reply_markup={reply_markup_encoded}".format(
|
194
|
+
people_id, escaped_text[:MAX_MSG_LENGTH], reply_markup_encoded=reply_markup_encoded
|
195
|
+
)
|
196
|
+
)
|
197
|
+
else:
|
198
|
+
url = (
|
199
|
+
botsUrl
|
200
|
+
+ "/sendMessage?chat_id={}&text={}&parse_mode={parse_mode}".format(
|
201
|
+
people_id, escaped_text[:MAX_MSG_LENGTH], parse_mode=parse_type
|
202
|
+
)
|
194
203
|
)
|
195
|
-
)
|
196
204
|
try:
|
197
205
|
resp = requests.get(
|
198
206
|
url, timeout=2 # 2 sec timeout
|
@@ -0,0 +1 @@
|
|
1
|
+
VERSION='0.13.20250208.217'
|
@@ -1,9 +1,9 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: PKDevTools
|
3
|
-
Version: 0.13.20250208.
|
3
|
+
Version: 0.13.20250208.217
|
4
4
|
Summary: A general day-to-day toolset for PKScreener repos
|
5
5
|
Home-page: https://github.com/pkjmesra/PKDevTools
|
6
|
-
Download-URL: https://github.com/pkjmesra/PKDevTools/archive/v0.13.20250208.
|
6
|
+
Download-URL: https://github.com/pkjmesra/PKDevTools/archive/v0.13.20250208.217.zip
|
7
7
|
Author: pkjmesra
|
8
8
|
Author-email: pkjmesra@gmail.com
|
9
9
|
License: OSI Approved (MIT)
|
@@ -1,9 +1,9 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: PKDevTools
|
3
|
-
Version: 0.13.20250208.
|
3
|
+
Version: 0.13.20250208.217
|
4
4
|
Summary: A general day-to-day toolset for PKScreener repos
|
5
5
|
Home-page: https://github.com/pkjmesra/PKDevTools
|
6
|
-
Download-URL: https://github.com/pkjmesra/PKDevTools/archive/v0.13.20250208.
|
6
|
+
Download-URL: https://github.com/pkjmesra/PKDevTools/archive/v0.13.20250208.217.zip
|
7
7
|
Author: pkjmesra
|
8
8
|
Author-email: pkjmesra@gmail.com
|
9
9
|
License: OSI Approved (MIT)
|
@@ -1 +0,0 @@
|
|
1
|
-
VERSION='0.13.20250208.215'
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools/classes/Archiver.py
RENAMED
File without changes
|
{pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools/classes/ColorText.py
RENAMED
File without changes
|
{pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools/classes/Committer.py
RENAMED
File without changes
|
{pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools/classes/CookieHelper.py
RENAMED
File without changes
|
{pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools/classes/Environment.py
RENAMED
File without changes
|
File without changes
|
{pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools/classes/FunctionTimeouts.py
RENAMED
File without changes
|
{pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools/classes/GmailReader.py
RENAMED
File without changes
|
{pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools/classes/MarketHours.py
RENAMED
File without changes
|
{pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools/classes/MenuOptions.py
RENAMED
File without changes
|
{pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools/classes/NSEMarketStatus.py
RENAMED
File without changes
|
{pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools/classes/OutputControls.py
RENAMED
File without changes
|
{pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools/classes/PKDateUtilities.py
RENAMED
File without changes
|
File without changes
|
{pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools/classes/PKJoinableQueue.py
RENAMED
File without changes
|
File without changes
|
{pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools/classes/PKPickler.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools/classes/Singleton.py
RENAMED
File without changes
|
{pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools/classes/SuppressOutput.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools/classes/WorkflowManager.py
RENAMED
File without changes
|
{pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools/classes/githubutilities.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools.egg-info/SOURCES.txt
RENAMED
File without changes
|
File without changes
|
{pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools.egg-info/entry_points.txt
RENAMED
File without changes
|
{pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools.egg-info/not-zip-safe
RENAMED
File without changes
|
{pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools.egg-info/requires.txt
RENAMED
File without changes
|
{pkdevtools-0.13.20250208.215 → pkdevtools-0.13.20250208.217}/PKDevTools.egg-info/top_level.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|