No project description provided
Project description
<b>BODY SCAN</b>
<section>
<b>quick start</b>
<b>How to start checks</b>
<code python3>
import BODY_SCAN
import pathlib
SCAN = BODY_SCAN.START (
GLOB = pathlib.Path (__file__).parent.resolve () + '/**/*HEALTH.py',
SIMULTANEOUS = True,
RELATIVE_PATH = pathlib.Path (__file__).parent.resolve ()
)
</code>
<b>BODY_SCAN.START OPTIONS DESCRIPTIONS</b>
<code>
#
# REQUIRED
# This is all the files that are sent to the scanner.
#
GLOB = SEARCH + '/**/*HEALTH.py',
#
# This runs all the checks in a thread pool,
# so maybe at the same time, more or less.
#
# If False, then checks are run one at a time
#
SIMULTANEOUS = True,
#
# OPTIONAL
# These are the folders that are added to "sys.path"
#
MODULE_PATHS = [
normpath (join (SEARCH, "MODULES"))
],
#
# OPTIONAL
# This is the folder path to remove from the paths in the output.
#
RELATIVE_PATH = SEARCH
</code>
<b>How to write checks</b>
<code python3>
def CHECK_1 ():
print ("CHECK 1")
def CHECK_2 ():
raise Exception ("NOT 100%")
CHECKS = {
"CHECK 1": CHECK_1,
"CHECK 2": CHECK_2
}
</code>
<b>Output</b>
<code python3>
{
"PATHS": [
{
"PATH": "PATH_1_HEALTH.py",
"STATS": {
"PASSES": 1,
"ALARMS": 1
},
"CHECKS": [
{
"CHECK": "CHECK 1",
"PASSED": true,
"ELAPSED": [
5.320599666447379e-05,
"SECONDS"
]
},
{
"CHECK": "CHECK 2",
"PASSED": false,
"EXCEPTION": "Exception('NOT 100%')",
"EXCEPTION TRACE": [
"Traceback (most recent call last):",
" File \"/REPTILIAN_CLIMATES/MODULES/BODY_SCAN/src/SCAN_PROC/KEG/SCAN.py\", line 69, in SCAN",
" CHECKS [ CHECK ] ()",
" File \"<string>\", line 24, in CHECK_3",
"Exception: NOT 100%"
]
}
]
}
],
"STATS": {
"EMPTY": 1,
"CHECKS": {
"PASSES": 2,
"ALARMS": 1
}
}
}
</code>
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
BODY_SCAN-0.0.27.tar.gz
(6.9 kB
view hashes)