PKDevTools 0.13.20250218.236__tar.gz → 0.13.20250221.237__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- pkdevtools-0.13.20250221.237/PKDevTools/classes/__init__.py +1 -0
- {pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/pubsub/publisher.py +5 -0
- pkdevtools-0.13.20250221.237/PKDevTools/classes/pubsub/subscriber.py +84 -0
- {pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools.egg-info/PKG-INFO +2 -2
- {pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKG-INFO +2 -2
- pkdevtools-0.13.20250218.236/PKDevTools/classes/__init__.py +0 -1
- pkdevtools-0.13.20250218.236/PKDevTools/classes/pubsub/subscriber.py +0 -54
- {pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/LICENSE +0 -0
- {pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/LICENSE.txt +0 -0
- {pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/README.txt +0 -0
- {pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/__init__.py +0 -0
- {pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/Archiver.py +0 -0
- {pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/ColorText.py +0 -0
- {pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/Committer.py +0 -0
- {pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/CookieHelper.py +0 -0
- {pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/DBManager.py +0 -0
- {pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/Environment.py +0 -0
- {pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/Fetcher.py +0 -0
- {pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/FunctionTimeouts.py +0 -0
- {pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/GmailReader.py +0 -0
- {pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/MarketHours.py +0 -0
- {pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/MenuOptions.py +0 -0
- {pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/NSEMarketStatus.py +0 -0
- {pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/OutputControls.py +0 -0
- {pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/PKDateUtilities.py +0 -0
- {pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/PKGitFolderDownloader.py +0 -0
- {pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/PKJoinableQueue.py +0 -0
- {pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/PKMultiProcessorClient.py +0 -0
- {pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/PKPickler.py +0 -0
- {pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/PKTimer.py +0 -0
- {pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/Pikey.py +0 -0
- {pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/Singleton.py +0 -0
- {pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/SuppressOutput.py +0 -0
- {pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/System.py +0 -0
- {pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/Telegram.py +0 -0
- {pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/UserSubscriptions.py +0 -0
- {pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/Utils.py +0 -0
- {pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/WorkflowManager.py +0 -0
- {pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/githubutilities.py +0 -0
- {pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/log.py +0 -0
- {pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/multiprocessing_logging.py +0 -0
- {pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/pubsub/__init__.py +0 -0
- {pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/pubsub/events.py +0 -0
- {pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/squash.py +0 -0
- {pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/updater.py +0 -0
- {pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/release.md +0 -0
- {pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/requirements.txt +0 -0
- {pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools.egg-info/SOURCES.txt +0 -0
- {pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools.egg-info/dependency_links.txt +0 -0
- {pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools.egg-info/entry_points.txt +0 -0
- {pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools.egg-info/not-zip-safe +0 -0
- {pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools.egg-info/requires.txt +0 -0
- {pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools.egg-info/top_level.txt +0 -0
- {pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/README.md +0 -0
- {pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/setup.cfg +0 -0
- {pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/setup.py +0 -0
@@ -0,0 +1 @@
|
|
1
|
+
VERSION='0.13.20250221.237'
|
{pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/pubsub/publisher.py
RENAMED
@@ -29,3 +29,8 @@ class PKUserService:
|
|
29
29
|
print(f"[UserService] Notifying for scanner: {scannerID} with notification: {notification}")
|
30
30
|
# Publish the event
|
31
31
|
globalEventsSignal.send(self, scannerID=scannerID,notification=notification)
|
32
|
+
|
33
|
+
def send_event(self, event_name, event_params=None):
|
34
|
+
"""Send a custom event to Google Analytics."""
|
35
|
+
# Publish the event
|
36
|
+
globalEventsSignal.send(self, eventType="ga",event_name=event_name,event_params=event_params)
|
@@ -0,0 +1,84 @@
|
|
1
|
+
"""
|
2
|
+
The MIT License (MIT)
|
3
|
+
|
4
|
+
Copyright (c) 2023 pkjmesra
|
5
|
+
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
8
|
+
in the Software without restriction, including without limitation the rights
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
11
|
+
furnished to do so, subject to the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
14
|
+
copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
22
|
+
SOFTWARE.
|
23
|
+
|
24
|
+
"""
|
25
|
+
import uuid
|
26
|
+
import requests
|
27
|
+
from PKDevTools.classes.pubsub.events import globalEventsSignal
|
28
|
+
from PKDevTools.classes.DBManager import DBManager
|
29
|
+
from PKDevTools.classes.Telegram import send_message
|
30
|
+
|
31
|
+
class PKNotificationService:
|
32
|
+
def __init__(self):
|
33
|
+
# Subscribe to the event
|
34
|
+
globalEventsSignal.connect(self.notify)
|
35
|
+
|
36
|
+
def notify(self, sender, **kwargs):
|
37
|
+
if 'eventType' in kwargs:
|
38
|
+
if kwargs['eventType'] == "ga":
|
39
|
+
# Capture GA event
|
40
|
+
event_name = kwargs['event_name']
|
41
|
+
event_params = kwargs['event_params']
|
42
|
+
if event_params is None:
|
43
|
+
event_params = {}
|
44
|
+
|
45
|
+
payload = {
|
46
|
+
"client_id": str(uuid.uuid4()), # Unique client ID for GA
|
47
|
+
"events": [{
|
48
|
+
"name": event_name,
|
49
|
+
"params": event_params
|
50
|
+
}]
|
51
|
+
}
|
52
|
+
# Google Analytics API Details
|
53
|
+
MEASUREMENT_ID = "G-T0TLV56Y0C"
|
54
|
+
API_SECRET = "2dD6iqHQQl2EzhCvHXA7EQ"
|
55
|
+
GA_ENDPOINT = f"https://www.google-analytics.com/mp/collect?measurement_id={MEASUREMENT_ID}&api_secret={API_SECRET}"
|
56
|
+
|
57
|
+
try:
|
58
|
+
response = requests.post(GA_ENDPOINT, json=payload)
|
59
|
+
# if response.status_code == 204:
|
60
|
+
# print(f"Event '{event_name}' sent successfully")
|
61
|
+
# else:
|
62
|
+
# print(f"Error sending event: {response.text}")
|
63
|
+
except Exception as e:
|
64
|
+
# print(f"Failed to send event: {e}")
|
65
|
+
pass
|
66
|
+
else:
|
67
|
+
notificationText = kwargs['notification'] if 'notification' in kwargs else ""
|
68
|
+
scannerID = kwargs['scannerID'] if 'scannerID' in kwargs else ""
|
69
|
+
print(f"[Notification] Notifying for {scannerID} with data: {notificationText}")
|
70
|
+
dbManager = DBManager()
|
71
|
+
try:
|
72
|
+
if len(str(scannerID)) > 0:
|
73
|
+
userIDs = dbManager.usersForScannerJobId(scannerJobId=scannerID)
|
74
|
+
if len(userIDs) > 0:
|
75
|
+
for userID in userIDs:
|
76
|
+
send_message(message=notificationText,userID=userID,parse_type="HTML",)
|
77
|
+
else:
|
78
|
+
print(f"Error encountered:\n0 length scannerID passed for {notificationText}")
|
79
|
+
except Exception as e:
|
80
|
+
print(f"Error encountered:\n{e}")
|
81
|
+
pass
|
82
|
+
|
83
|
+
# Ensure the subscriber is instantiated so it listens to events
|
84
|
+
notification_service = PKNotificationService()
|
@@ -1,9 +1,9 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: PKDevTools
|
3
|
-
Version: 0.13.
|
3
|
+
Version: 0.13.20250221.237
|
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.
|
6
|
+
Download-URL: https://github.com/pkjmesra/PKDevTools/archive/v0.13.20250221.237.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.
|
3
|
+
Version: 0.13.20250221.237
|
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.
|
6
|
+
Download-URL: https://github.com/pkjmesra/PKDevTools/archive/v0.13.20250221.237.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.20250218.236'
|
@@ -1,54 +0,0 @@
|
|
1
|
-
"""
|
2
|
-
The MIT License (MIT)
|
3
|
-
|
4
|
-
Copyright (c) 2023 pkjmesra
|
5
|
-
|
6
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
-
of this software and associated documentation files (the "Software"), to deal
|
8
|
-
in the Software without restriction, including without limitation the rights
|
9
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
-
copies of the Software, and to permit persons to whom the Software is
|
11
|
-
furnished to do so, subject to the following conditions:
|
12
|
-
|
13
|
-
The above copyright notice and this permission notice shall be included in all
|
14
|
-
copies or substantial portions of the Software.
|
15
|
-
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
22
|
-
SOFTWARE.
|
23
|
-
|
24
|
-
"""
|
25
|
-
from PKDevTools.classes.pubsub.events import globalEventsSignal
|
26
|
-
from PKDevTools.classes.DBManager import DBManager
|
27
|
-
from PKDevTools.classes.Telegram import send_message
|
28
|
-
|
29
|
-
class PKNotificationService:
|
30
|
-
def __init__(self):
|
31
|
-
# Subscribe to the event
|
32
|
-
globalEventsSignal.connect(self.notify)
|
33
|
-
|
34
|
-
def notify(self, sender, **kwargs):
|
35
|
-
notificationText = kwargs['notification'] if 'notification' in kwargs else ""
|
36
|
-
scannerID = kwargs['scannerID'] if 'scannerID' in kwargs else ""
|
37
|
-
print(f"[Notification] Notifying for {scannerID} with data: {notificationText}")
|
38
|
-
dbManager = DBManager()
|
39
|
-
try:
|
40
|
-
if len(str(scannerID)) > 0:
|
41
|
-
userIDs = dbManager.usersForScannerJobId(scannerJobId=scannerID)
|
42
|
-
if len(userIDs) > 0:
|
43
|
-
for userID in userIDs:
|
44
|
-
send_message(message=notificationText,userID=userID,parse_type="HTML",)
|
45
|
-
else:
|
46
|
-
print(f"Error encountered:\n0 length scannerID passed for {notificationText}")
|
47
|
-
except Exception as e:
|
48
|
-
print(f"Error encountered:\n{e}")
|
49
|
-
pass
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
# Ensure the subscriber is instantiated so it listens to events
|
54
|
-
notification_service = PKNotificationService()
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/Archiver.py
RENAMED
File without changes
|
{pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/ColorText.py
RENAMED
File without changes
|
{pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/Committer.py
RENAMED
File without changes
|
{pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/CookieHelper.py
RENAMED
File without changes
|
{pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/DBManager.py
RENAMED
File without changes
|
{pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/Environment.py
RENAMED
File without changes
|
File without changes
|
{pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/FunctionTimeouts.py
RENAMED
File without changes
|
{pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/GmailReader.py
RENAMED
File without changes
|
{pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/MarketHours.py
RENAMED
File without changes
|
{pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/MenuOptions.py
RENAMED
File without changes
|
{pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/NSEMarketStatus.py
RENAMED
File without changes
|
{pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/OutputControls.py
RENAMED
File without changes
|
{pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/PKDateUtilities.py
RENAMED
File without changes
|
File without changes
|
{pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/PKJoinableQueue.py
RENAMED
File without changes
|
File without changes
|
{pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/PKPickler.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/Singleton.py
RENAMED
File without changes
|
{pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/SuppressOutput.py
RENAMED
File without changes
|
File without changes
|
{pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/Telegram.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/WorkflowManager.py
RENAMED
File without changes
|
{pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/githubutilities.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/pubsub/__init__.py
RENAMED
File without changes
|
{pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools/classes/pubsub/events.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools.egg-info/SOURCES.txt
RENAMED
File without changes
|
File without changes
|
{pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools.egg-info/entry_points.txt
RENAMED
File without changes
|
{pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools.egg-info/not-zip-safe
RENAMED
File without changes
|
{pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools.egg-info/requires.txt
RENAMED
File without changes
|
{pkdevtools-0.13.20250218.236 → pkdevtools-0.13.20250221.237}/PKDevTools.egg-info/top_level.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|