lucos-schedule-tracker-pythonclient 1.0.0__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.
- lucos_schedule_tracker_pythonclient-1.0.0/PKG-INFO +11 -0
- lucos_schedule_tracker_pythonclient-1.0.0/README.md +2 -0
- lucos_schedule_tracker_pythonclient-1.0.0/lucos_schedule_tracker_pythonclient.egg-info/PKG-INFO +11 -0
- lucos_schedule_tracker_pythonclient-1.0.0/lucos_schedule_tracker_pythonclient.egg-info/SOURCES.txt +8 -0
- lucos_schedule_tracker_pythonclient-1.0.0/lucos_schedule_tracker_pythonclient.egg-info/dependency_links.txt +1 -0
- lucos_schedule_tracker_pythonclient-1.0.0/lucos_schedule_tracker_pythonclient.egg-info/requires.txt +1 -0
- lucos_schedule_tracker_pythonclient-1.0.0/lucos_schedule_tracker_pythonclient.egg-info/top_level.txt +1 -0
- lucos_schedule_tracker_pythonclient-1.0.0/pyproject.toml +16 -0
- lucos_schedule_tracker_pythonclient-1.0.0/schedule_tracker.py +30 -0
- lucos_schedule_tracker_pythonclient-1.0.0/setup.cfg +4 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: lucos_schedule_tracker_pythonclient
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Python library for sending updates to lucos_schedule_tracker
|
|
5
|
+
Classifier: Programming Language :: Python :: 3
|
|
6
|
+
Requires-Python: >=3.8
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
Requires-Dist: requests>=2.28
|
|
9
|
+
|
|
10
|
+
# lucos_schedule_tracker_pythonclient
|
|
11
|
+
Python library for sending updates to lucos_schedule_tracker
|
lucos_schedule_tracker_pythonclient-1.0.0/lucos_schedule_tracker_pythonclient.egg-info/PKG-INFO
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: lucos_schedule_tracker_pythonclient
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Python library for sending updates to lucos_schedule_tracker
|
|
5
|
+
Classifier: Programming Language :: Python :: 3
|
|
6
|
+
Requires-Python: >=3.8
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
Requires-Dist: requests>=2.28
|
|
9
|
+
|
|
10
|
+
# lucos_schedule_tracker_pythonclient
|
|
11
|
+
Python library for sending updates to lucos_schedule_tracker
|
lucos_schedule_tracker_pythonclient-1.0.0/lucos_schedule_tracker_pythonclient.egg-info/SOURCES.txt
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
README.md
|
|
2
|
+
pyproject.toml
|
|
3
|
+
schedule_tracker.py
|
|
4
|
+
lucos_schedule_tracker_pythonclient.egg-info/PKG-INFO
|
|
5
|
+
lucos_schedule_tracker_pythonclient.egg-info/SOURCES.txt
|
|
6
|
+
lucos_schedule_tracker_pythonclient.egg-info/dependency_links.txt
|
|
7
|
+
lucos_schedule_tracker_pythonclient.egg-info/requires.txt
|
|
8
|
+
lucos_schedule_tracker_pythonclient.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
lucos_schedule_tracker_pythonclient-1.0.0/lucos_schedule_tracker_pythonclient.egg-info/requires.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
requests>=2.28
|
lucos_schedule_tracker_pythonclient-1.0.0/lucos_schedule_tracker_pythonclient.egg-info/top_level.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
schedule_tracker
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "lucos_schedule_tracker_pythonclient"
|
|
7
|
+
version = "1.0.0"
|
|
8
|
+
description = "Python library for sending updates to lucos_schedule_tracker"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.8"
|
|
11
|
+
classifiers = [
|
|
12
|
+
"Programming Language :: Python :: 3"
|
|
13
|
+
]
|
|
14
|
+
dependencies = [
|
|
15
|
+
"requests>=2.28"
|
|
16
|
+
]
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import os, sys, requests
|
|
2
|
+
from datetime import datetime
|
|
3
|
+
|
|
4
|
+
try:
|
|
5
|
+
SYSTEM = os.environ["SYSTEM"]
|
|
6
|
+
except KeyError:
|
|
7
|
+
sys.exit("\033[91mSYSTEM environment variable not set\033[0m")
|
|
8
|
+
try:
|
|
9
|
+
SCHEDULE_TRACKER_ENDPOINT = os.environ["SCHEDULE_TRACKER_ENDPOINT"]
|
|
10
|
+
except KeyError:
|
|
11
|
+
sys.exit("\033[91mSCHEDULE_TRACKER_ENDPOINT environment variable not set - needs to be the URL of a running lucos_schedule_tracker instance\033[0m")
|
|
12
|
+
|
|
13
|
+
session = requests.Session()
|
|
14
|
+
session.headers.update({
|
|
15
|
+
"User-Agent": SYSTEM,
|
|
16
|
+
"Content-Type": "application/json",
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
def updateScheduleTracker(success: bool, system: str = SYSTEM, message: str = None, frequency: int = (24 * 60 * 60)):
|
|
20
|
+
payload = {
|
|
21
|
+
"system": system,
|
|
22
|
+
"frequency": frequency,
|
|
23
|
+
"status": "success" if success else "error",
|
|
24
|
+
"message": message,
|
|
25
|
+
}
|
|
26
|
+
try:
|
|
27
|
+
schedule_tracker_response = requests.post(SCHEDULE_TRACKER_ENDPOINT, json=payload, timeout=5)
|
|
28
|
+
schedule_tracker_response.raise_for_status()
|
|
29
|
+
except Exception as error:
|
|
30
|
+
print("\033[91m [{}] ** Error calling schedule-tracker: {}\033[0m".format(datetime.now().isoformat(), error), flush=True)
|