Automatic code cleanups and import optimizations.

This commit is contained in:
Johannes Findeisen 2023-02-12 03:31:52 +01:00
commit b308068617
26 changed files with 6738 additions and 5928 deletions

View file

@ -129,7 +129,8 @@ complete documentation.
- 15.10 - Date based release - 15.10 - Date based release
- 23 - Serial release - 23 - Serial release
(More information: [https://packaging.python.org/en/latest/guides/distributing-packages-using-setuptools/#choosing-a-versioning-scheme](https://packaging.python.org/en/latest/guides/distributing-packages-using-setuptools/#choosing-a-versioning-scheme) & (More
information: [https://packaging.python.org/en/latest/guides/distributing-packages-using-setuptools/#choosing-a-versioning-scheme](https://packaging.python.org/en/latest/guides/distributing-packages-using-setuptools/#choosing-a-versioning-scheme) &
[https://peps.python.org/pep-0440/#public-version-identifiers](https://peps.python.org/pep-0440/#public-version-identifiers)) [https://peps.python.org/pep-0440/#public-version-identifiers](https://peps.python.org/pep-0440/#public-version-identifiers))
### Configuration file rules ### Configuration file rules

View file

@ -12,11 +12,10 @@ import sys
from linspector.core.configuration import Configuration from linspector.core.configuration import Configuration
from linspector.core.environment import Environment from linspector.core.environment import Environment
from linspector.core.logger import Log
from linspector.core.linspector import Linspector from linspector.core.linspector import Linspector
from linspector.core.logger import Log
from linspector.core.monitors import Monitors from linspector.core.monitors import Monitors
# i currently only increase the 3rd number because the goal is that 0.19.* will become the first # i currently only increase the 3rd number because the goal is that 0.19.* will become the first
# stable version. # stable version.
__version__ = '0.19.62.dev1' __version__ = '0.19.62.dev1'

View file

@ -14,9 +14,10 @@ import logging.handlers
import os import os
import sys import sys
from linspector.core.helpers import log
from linspector.core.configuration import Configuration from linspector.core.configuration import Configuration
from linspector.core.environment import Environment from linspector.core.environment import Environment
from linspector.core.helpers import log
from linspector.core.linspector import Linspector from linspector.core.linspector import Linspector
from linspector.core.monitors import Monitors from linspector.core.monitors import Monitors

View file

@ -1,13 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?><!-- Created with Inkscape (http://www.inkscape.org/) --><svg height="297mm" id="svg5088" inkscape:output_extension="org.inkscape.output.svg.inkscape" inkscape:version="0.46" sodipodi:version="0.32" width="210mm" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <?xml version="1.0" encoding="UTF-8"?><!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg height="297mm" id="svg5088" inkscape:output_extension="org.inkscape.output.svg.inkscape" inkscape:version="0.46"
sodipodi:version="0.32" width="210mm" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink">
<defs id="defs3"> <defs id="defs3">
<inkscape:perspective id="perspective5094" inkscape:persp3d-origin="372.04724 : 350.78739 : 1" inkscape:vp_x="0 : 526.18109 : 1" inkscape:vp_y="0 : 1000 : 0" inkscape:vp_z="744.09448 : 526.18109 : 1" sodipodi:type="inkscape:persp3d"/> <inkscape:perspective id="perspective5094" inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
<linearGradient gradientUnits="userSpaceOnUse" id="linearGradient3294" inkscape:collect="always" x1="606.10046" x2="470.78317" xlink:href="#linearGradient3288" y1="335.81693" y2="407.94183"/> inkscape:vp_x="0 : 526.18109 : 1" inkscape:vp_y="0 : 1000 : 0"
<linearGradient gradientUnits="userSpaceOnUse" id="linearGradient3286" inkscape:collect="always" x1="22.627417" x2="342.23969" xlink:href="#linearGradient3280" y1="259.38269" y2="417.7746"/> inkscape:vp_z="744.09448 : 526.18109 : 1" sodipodi:type="inkscape:persp3d"/>
<linearGradient gradientUnits="userSpaceOnUse" id="linearGradient3276" inkscape:collect="always" x1="253.69392" x2="316.32159" xlink:href="#linearGradient3270" y1="392.06641" y2="276.10086"/> <linearGradient gradientUnits="userSpaceOnUse" id="linearGradient3294" inkscape:collect="always" x1="606.10046"
<linearGradient gradientUnits="userSpaceOnUse" id="linearGradient3266" inkscape:collect="always" x1="86.164584" x2="188.14864" xlink:href="#linearGradient3260" y1="169.8075" y2="169.8075"/> x2="470.78317" xlink:href="#linearGradient3288" y1="335.81693" y2="407.94183"/>
<linearGradient gradientUnits="userSpaceOnUse" id="linearGradient3228" inkscape:collect="always" x1="27.105211" x2="507.92923" xlink:href="#linearGradient3222" y1="261.07654" y2="405.32632"/> <linearGradient gradientUnits="userSpaceOnUse" id="linearGradient3286" inkscape:collect="always" x1="22.627417"
<linearGradient gradientUnits="userSpaceOnUse" id="linearGradient3202" inkscape:collect="always" x1="222.18834" x2="464.36908" xlink:href="#linearGradient3196" y1="187.6158" y2="187.6158"/> x2="342.23969" xlink:href="#linearGradient3280" y1="259.38269" y2="417.7746"/>
<inkscape:perspective id="perspective3342" inkscape:persp3d-origin="372.04724 : 350.78739 : 1" inkscape:vp_x="0 : 526.18109 : 1" inkscape:vp_y="0 : 1000 : 0" inkscape:vp_z="744.09448 : 526.18109 : 1" sodipodi:type="inkscape:persp3d"/> <linearGradient gradientUnits="userSpaceOnUse" id="linearGradient3276" inkscape:collect="always" x1="253.69392"
x2="316.32159" xlink:href="#linearGradient3270" y1="392.06641" y2="276.10086"/>
<linearGradient gradientUnits="userSpaceOnUse" id="linearGradient3266" inkscape:collect="always" x1="86.164584"
x2="188.14864" xlink:href="#linearGradient3260" y1="169.8075" y2="169.8075"/>
<linearGradient gradientUnits="userSpaceOnUse" id="linearGradient3228" inkscape:collect="always" x1="27.105211"
x2="507.92923" xlink:href="#linearGradient3222" y1="261.07654" y2="405.32632"/>
<linearGradient gradientUnits="userSpaceOnUse" id="linearGradient3202" inkscape:collect="always" x1="222.18834"
x2="464.36908" xlink:href="#linearGradient3196" y1="187.6158" y2="187.6158"/>
<inkscape:perspective id="perspective3342" inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
inkscape:vp_x="0 : 526.18109 : 1" inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="744.09448 : 526.18109 : 1" sodipodi:type="inkscape:persp3d"/>
<linearGradient id="linearGradient3184"> <linearGradient id="linearGradient3184">
<stop id="stop3186" offset="0" style="stop-color:#c17d11;stop-opacity:1;"/> <stop id="stop3186" offset="0" style="stop-color:#c17d11;stop-opacity:1;"/>
<stop id="stop3192" offset="0.5" style="stop-color:#c17d11;stop-opacity:0.49803922;"/> <stop id="stop3192" offset="0.5" style="stop-color:#c17d11;stop-opacity:0.49803922;"/>
@ -48,7 +64,10 @@
<stop id="stop3292" offset="1" style="stop-color:#8f5902;stop-opacity:0;"/> <stop id="stop3292" offset="1" style="stop-color:#8f5902;stop-opacity:0;"/>
</linearGradient> </linearGradient>
</defs> </defs>
<sodipodi:namedview bordercolor="#666666" borderopacity="1.0" id="base" inkscape:current-layer="layer1" inkscape:cx="-285.71429" inkscape:cy="497.14286" inkscape:document-units="mm" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="0.35" pagecolor="#ffffff" showgrid="false"/> <sodipodi:namedview bordercolor="#666666" borderopacity="1.0" id="base" inkscape:current-layer="layer1"
inkscape:cx="-285.71429" inkscape:cy="497.14286" inkscape:document-units="mm"
inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="0.35" pagecolor="#ffffff"
showgrid="false"/>
<metadata id="metadata4"> <metadata id="metadata4">
<rdf:RDF> <rdf:RDF>
<cc:Work rdf:about=""> <cc:Work rdf:about="">
@ -97,19 +116,43 @@
<g id="layer1" inkscape:groupmode="layer" inkscape:label="Layer 1"> <g id="layer1" inkscape:groupmode="layer" inkscape:label="Layer 1">
<g id="g6815"> <g id="g6815">
<g id="g3296" transform="translate(57.978143,318.94882)"> <g id="g3296" transform="translate(57.978143,318.94882)">
<path d="M 85.298587,247.36749 C 85.298587,247.36749 47.634276,255.12191 32.125442,278.38516 C 16.616608,301.64841 4.4310954,320.48057 16.616608,339.31272 C 28.80212,358.14488 69.789753,395.80919 110.77739,399.13251 C 151.76502,402.45583 304.63781,445.65901 363.34982,437.90459 C 422.06184,430.15018 572.71908,402.45583 572.71908,402.45583 C 572.71908,402.45583 634.75442,384.73145 618.13781,350.39046 C 601.5212,316.04947 517.33039,289.4629 517.33039,289.4629" id="path3348" style="fill:url(#linearGradient3228);fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:20;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"/> <path d="M 85.298587,247.36749 C 85.298587,247.36749 47.634276,255.12191 32.125442,278.38516 C 16.616608,301.64841 4.4310954,320.48057 16.616608,339.31272 C 28.80212,358.14488 69.789753,395.80919 110.77739,399.13251 C 151.76502,402.45583 304.63781,445.65901 363.34982,437.90459 C 422.06184,430.15018 572.71908,402.45583 572.71908,402.45583 C 572.71908,402.45583 634.75442,384.73145 618.13781,350.39046 C 601.5212,316.04947 517.33039,289.4629 517.33039,289.4629"
<path d="M 80.867491,287.24735 C 80.867491,287.24735 93.053004,334.88163 122.9629,339.31272 C 152.87279,343.74382 305.74558,348.17491 326.79329,347.06714 C 347.84099,345.95936 494.06714,318.26502 510.68375,311.61837 C 527.30035,304.97173 515.11484,287.24735 515.11484,287.24735 C 515.11484,287.24735 479.66608,234.0742 477.45053,225.21201 C 475.23498,216.34982 460.83392,94.4947 458.61837,81.201413 C 456.40283,67.908127 436.4629,37.998233 402.12191,35.782686 C 367.78092,33.567138 281.37456,23.597173 263.65018,30.243816 C 245.9258,36.890459 149.54947,40.213781 130.71731,62.369258 C 111.88516,84.524735 80.867491,286.13958 80.867491,287.24735 z" id="path3346" style="fill:url(#linearGradient3202);fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:20;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"/> id="path3348"
<path d="M 178.59568,55.443594 C 178.59568,55.443594 189.56209,66.409996 187.99546,88.342799 C 186.42883,110.2756 178.59568,284.1714 178.59568,284.1714 L 86.164584,276.33826 L 123.76368,64.843367 L 178.59568,55.443594 z" id="path4122" style="opacity:0.90119761;fill:url(#linearGradient3266);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"/> style="fill:url(#linearGradient3228);fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:20;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"/>
<path d="M 90.864471,274.77163 C 90.864471,274.77163 275.72667,296.70443 311.75913,292.00454 C 347.79159,287.30466 490.35482,260.67197 490.35482,260.67197 L 495.0547,257.53871 L 518.55413,298.27106 L 499.75459,315.50398 L 318.02565,348.40318 L 130.03019,339.00341 L 93.997728,320.20386 L 78.33144,290.43791 L 90.864471,274.77163 z" id="path4120" style="fill:#8f5902;fill-rule:evenodd;stroke:none;stroke-width:10;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"/> <path d="M 80.867491,287.24735 C 80.867491,287.24735 93.053004,334.88163 122.9629,339.31272 C 152.87279,343.74382 305.74558,348.17491 326.79329,347.06714 C 347.84099,345.95936 494.06714,318.26502 510.68375,311.61837 C 527.30035,304.97173 515.11484,287.24735 515.11484,287.24735 C 515.11484,287.24735 479.66608,234.0742 477.45053,225.21201 C 475.23498,216.34982 460.83392,94.4947 458.61837,81.201413 C 456.40283,67.908127 436.4629,37.998233 402.12191,35.782686 C 367.78092,33.567138 281.37456,23.597173 263.65018,30.243816 C 245.9258,36.890459 149.54947,40.213781 130.71731,62.369258 C 111.88516,84.524735 80.867491,286.13958 80.867491,287.24735 z"
<path d="M 531.08716,298.27106 L 610.98523,339.00341 L 623.51826,375.03587 L 576.5194,398.5353 L 459.02224,426.73462 C 459.02224,426.73462 476.25516,433.00114 510.72099,393.83542 C 545.18682,354.6697 534.22042,298.27106 531.08716,298.27106 z" id="path4124" style="fill:url(#linearGradient3294);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"/> id="path3346"
<path d="M 73.631554,273.205 C 73.631554,273.205 48.565493,284.1714 48.565493,304.53757 C 48.565493,324.90375 45.432235,356.23632 61.098523,370.33598 C 76.764811,384.43564 130.03019,398.5353 130.03019,398.5353 C 130.03019,398.5353 89.297842,343.70329 89.297842,318.63723 C 89.297842,293.57117 73.631554,270.07174 73.631554,273.205 z" id="path4126" style="fill:#8f5902;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"/> style="fill:url(#linearGradient3202);fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:20;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"/>
<path d="M 526,292 C 526,292 546,308 484,323 C 422,338 319,350 319,350 C 319,350 292,351 319,362 C 346,373 510,387 531,366 C 552,345 577,340 576,319 C 575,298 523,292 526,292 z" id="path3166" style="fill:#c17d11;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"/> <path d="M 178.59568,55.443594 C 178.59568,55.443594 189.56209,66.409996 187.99546,88.342799 C 186.42883,110.2756 178.59568,284.1714 178.59568,284.1714 L 86.164584,276.33826 L 123.76368,64.843367 L 178.59568,55.443594 z"
<path d="M 80.867491,287.24735 C 80.867491,287.24735 93.053004,334.88163 122.9629,339.31272 C 152.87279,343.74382 305.74558,348.17491 326.79329,347.06714 C 347.84099,345.95936 494.06714,318.26502 510.68375,311.61837 C 527.30035,304.97173 515.11484,287.24735 515.11484,287.24735 C 515.11484,287.24735 479.66608,234.0742 477.45053,225.21201 C 475.23498,216.34982 460.83392,94.4947 458.61837,81.201413 C 456.40283,67.908127 436.4629,37.998233 402.12191,35.782686 C 367.78092,33.567138 281.37456,23.597173 263.65018,30.243816 C 245.9258,36.890459 149.54947,40.213781 130.71731,62.369258 C 111.88516,84.524735 80.867491,286.13958 80.867491,287.24735 z" id="path2445" style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:20;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"/> id="path4122"
<path d="M 85.298587,247.36749 C 85.298587,247.36749 47.634276,255.12191 32.125442,278.38516 C 16.616608,301.64841 4.4310954,320.48057 16.616608,339.31272 C 28.80212,358.14488 69.789753,395.80919 110.77739,399.13251 C 151.76502,402.45583 304.63781,445.65901 363.34982,437.90459 C 422.06184,430.15018 572.71908,402.45583 572.71908,402.45583 C 572.71908,402.45583 634.75442,384.73145 618.13781,350.39046 C 601.5212,316.04947 517.33039,289.4629 517.33039,289.4629" id="path3217" style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:20;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"/> style="opacity:0.90119761;fill:url(#linearGradient3266);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"/>
<path d="M 90.864471,274.77163 C 90.864471,274.77163 275.72667,296.70443 311.75913,292.00454 C 347.79159,287.30466 490.35482,260.67197 490.35482,260.67197 L 495.0547,257.53871 L 518.55413,298.27106 L 499.75459,315.50398 L 318.02565,348.40318 L 130.03019,339.00341 L 93.997728,320.20386 L 78.33144,290.43791 L 90.864471,274.77163 z" id="path3268" style="opacity:0.71556869;fill:url(#linearGradient3276);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:10;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"/> <path d="M 90.864471,274.77163 C 90.864471,274.77163 275.72667,296.70443 311.75913,292.00454 C 347.79159,287.30466 490.35482,260.67197 490.35482,260.67197 L 495.0547,257.53871 L 518.55413,298.27106 L 499.75459,315.50398 L 318.02565,348.40318 L 130.03019,339.00341 L 93.997728,320.20386 L 78.33144,290.43791 L 90.864471,274.77163 z"
<path d="M 77.781746,250.8974 L 79.195959,289.08117 L 110.30866,335.75022 L 175.36248,342.82128 L 298.39906,344.2355 L 470.93312,420.60303 L 332.34019,440.40202 L 142.83557,406.46089 L 35.355339,372.51977 L 5.6568542,320.19387 L 26.870058,282.0101 L 77.781746,250.8974 z" id="path3278" style="opacity:0.50898204;fill:url(#linearGradient3286);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"/> id="path4120"
style="fill:#8f5902;fill-rule:evenodd;stroke:none;stroke-width:10;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"/>
<path d="M 531.08716,298.27106 L 610.98523,339.00341 L 623.51826,375.03587 L 576.5194,398.5353 L 459.02224,426.73462 C 459.02224,426.73462 476.25516,433.00114 510.72099,393.83542 C 545.18682,354.6697 534.22042,298.27106 531.08716,298.27106 z"
id="path4124"
style="fill:url(#linearGradient3294);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"/>
<path d="M 73.631554,273.205 C 73.631554,273.205 48.565493,284.1714 48.565493,304.53757 C 48.565493,324.90375 45.432235,356.23632 61.098523,370.33598 C 76.764811,384.43564 130.03019,398.5353 130.03019,398.5353 C 130.03019,398.5353 89.297842,343.70329 89.297842,318.63723 C 89.297842,293.57117 73.631554,270.07174 73.631554,273.205 z"
id="path4126"
style="fill:#8f5902;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"/>
<path d="M 526,292 C 526,292 546,308 484,323 C 422,338 319,350 319,350 C 319,350 292,351 319,362 C 346,373 510,387 531,366 C 552,345 577,340 576,319 C 575,298 523,292 526,292 z"
id="path3166"
style="fill:#c17d11;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"/>
<path d="M 80.867491,287.24735 C 80.867491,287.24735 93.053004,334.88163 122.9629,339.31272 C 152.87279,343.74382 305.74558,348.17491 326.79329,347.06714 C 347.84099,345.95936 494.06714,318.26502 510.68375,311.61837 C 527.30035,304.97173 515.11484,287.24735 515.11484,287.24735 C 515.11484,287.24735 479.66608,234.0742 477.45053,225.21201 C 475.23498,216.34982 460.83392,94.4947 458.61837,81.201413 C 456.40283,67.908127 436.4629,37.998233 402.12191,35.782686 C 367.78092,33.567138 281.37456,23.597173 263.65018,30.243816 C 245.9258,36.890459 149.54947,40.213781 130.71731,62.369258 C 111.88516,84.524735 80.867491,286.13958 80.867491,287.24735 z"
id="path2445"
style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:20;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"/>
<path d="M 85.298587,247.36749 C 85.298587,247.36749 47.634276,255.12191 32.125442,278.38516 C 16.616608,301.64841 4.4310954,320.48057 16.616608,339.31272 C 28.80212,358.14488 69.789753,395.80919 110.77739,399.13251 C 151.76502,402.45583 304.63781,445.65901 363.34982,437.90459 C 422.06184,430.15018 572.71908,402.45583 572.71908,402.45583 C 572.71908,402.45583 634.75442,384.73145 618.13781,350.39046 C 601.5212,316.04947 517.33039,289.4629 517.33039,289.4629"
id="path3217"
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:20;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"/>
<path d="M 90.864471,274.77163 C 90.864471,274.77163 275.72667,296.70443 311.75913,292.00454 C 347.79159,287.30466 490.35482,260.67197 490.35482,260.67197 L 495.0547,257.53871 L 518.55413,298.27106 L 499.75459,315.50398 L 318.02565,348.40318 L 130.03019,339.00341 L 93.997728,320.20386 L 78.33144,290.43791 L 90.864471,274.77163 z"
id="path3268"
style="opacity:0.71556869;fill:url(#linearGradient3276);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:10;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"/>
<path d="M 77.781746,250.8974 L 79.195959,289.08117 L 110.30866,335.75022 L 175.36248,342.82128 L 298.39906,344.2355 L 470.93312,420.60303 L 332.34019,440.40202 L 142.83557,406.46089 L 35.355339,372.51977 L 5.6568542,320.19387 L 26.870058,282.0101 L 77.781746,250.8974 z"
id="path3278"
style="opacity:0.50898204;fill:url(#linearGradient3286);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"/>
</g> </g>
<rect height="697.14288" id="rect5949" style="opacity:0.50898204000000002;fill:none;fill-opacity:1;stroke:none;stroke-width:10;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" width="697.14288" x="23.428572" y="183.79076"/> <rect height="697.14288" id="rect5949"
style="opacity:0.50898204000000002;fill:none;fill-opacity:1;stroke:none;stroke-width:10;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
width="697.14288" x="23.428572" y="183.79076"/>
</g> </g>
</g> </g>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Before After
Before After

View file

@ -5,7 +5,6 @@
xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#" xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"

Before

Width:  |  Height:  |  Size: 360 KiB

After

Width:  |  Height:  |  Size: 428 KiB

Before After
Before After

File diff suppressed because it is too large Load diff

Before

Width:  |  Height:  |  Size: 305 KiB

After

Width:  |  Height:  |  Size: 329 KiB

Before After
Before After

View file

@ -7,9 +7,9 @@ import datetime
import importlib import importlib
import random import random
from apscheduler.schedulers.background import BackgroundScheduler
from apscheduler.jobstores.memory import MemoryJobStore
from apscheduler.executors.pool import ThreadPoolExecutor, ProcessPoolExecutor from apscheduler.executors.pool import ThreadPoolExecutor, ProcessPoolExecutor
from apscheduler.jobstores.memory import MemoryJobStore
from apscheduler.schedulers.background import BackgroundScheduler
def job_function(log, monitor): def job_function(log, monitor):

View file

@ -6,11 +6,8 @@ See LICENSE.txt (MIT license).
import configparser import configparser
import hashlib import hashlib
import importlib import importlib
from datetime import datetime
from binascii import crc32 from binascii import crc32
from datetime import datetime
from linspector.core.task import Task, TaskExecutor
class Monitor: class Monitor:
@ -33,7 +30,8 @@ class Monitor:
'identifier: ' + identifier + ' to: ' + str(self.__interval)) 'identifier: ' + identifier + ' to: ' + str(self.__interval))
except Exception as err: except Exception as err:
log.warning('no default_interval found in core configuration for identifier ' + log.warning('no default_interval found in core configuration for identifier ' +
identifier + ', set to default interval 300 seconds. error: ' + str(err)) identifier + ', set to default interval 300 seconds. error: ' + str(
err))
# default interval is 300 seconds (5 minutes) if not set in the monitor # default interval is 300 seconds (5 minutes) if not set in the monitor
# configuration args or a default_interval in the core configuration. # configuration args or a default_interval in the core configuration.
self.__interval = 300 self.__interval = 300

View file

@ -4,6 +4,7 @@ Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
See LICENSE.txt (MIT license). See LICENSE.txt (MIT license).
""" """
# see http://stackoverflow.com/questions/42558/python-and-the-singleton-pattern # see http://stackoverflow.com/questions/42558/python-and-the-singleton-pattern

View file

@ -4,7 +4,7 @@ Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
See LICENSE.txt (MIT license). See LICENSE.txt (MIT license).
""" """
from queue import Queue from queue import Queue
from threading import Event, Thread from threading import Thread
from linspector.core.singleton import Singleton from linspector.core.singleton import Singleton

View file

@ -3,7 +3,6 @@ This file is part of Linspector (https://linspector.org/)
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved. Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
See LICENSE.txt (MIT license). See LICENSE.txt (MIT license).
""" """
import gammu
from linspector.core.notification import Notification from linspector.core.notification import Notification

View file

@ -3,7 +3,6 @@ This file is part of Linspector (https://linspector.org/)
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved. Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
See LICENSE.txt (MIT license). See LICENSE.txt (MIT license).
""" """
import xmpp
from linspector.core.notification import Notification from linspector.core.notification import Notification

26
linspector/plugins/api.py Normal file
View file

@ -0,0 +1,26 @@
"""
This file is part of Linspector (https://linspector.org/)
Copyright (c) 2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
See LICENSE.txt (MIT license).
"""
# TODO: Make this a backend API using the modern FastAPI framework as a replacement for the
# traditional RPC plugin. Maybe it makes sense to maintain the RPC plugin too for simple usage by
# the Lish but I believe it makes sense to only create one backend for all clients.
from linspector.core.plugin import Plugin
def create(configuration, environment, linspector, log):
return APIPlugin(configuration, environment, linspector, log)
# TODO: check for all required configuration options and set defaults if needed.
class APIPlugin(Plugin):
def __init__(self, configuration, environment, linspector, log):
super().__init__(configuration, environment, linspector, log)
self.__configuration = configuration
self.__environment = environment
self.__linspector = linspector
self.__log = log
def run(self):
return

View file

@ -1,8 +0,0 @@
"""
This file is part of Linspector (https://linspector.org/)
Copyright (c) 2023 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
See LICENSE.txt (MIT license).
"""
# TODO: Make this a backend API using the modern FastAPI framework as a replacement for the
# traditional RPC plugin. Maybe it makes sense to maintain the RPC plugin too for simple usage by
# the Lish but I believe it makes sense to only create one backend for all clients.

View file

@ -3,9 +3,10 @@ This file is part of Linspector (https://linspector.org/)
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved. Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
See LICENSE.txt (MIT license). See LICENSE.txt (MIT license).
""" """
import cherrypy
import json import json
import cherrypy
from linspector.core.plugin import Plugin from linspector.core.plugin import Plugin

View file

@ -3,7 +3,6 @@ This file is part of Linspector (https://linspector.org/)
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved. Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
See LICENSE.txt (MIT license). See LICENSE.txt (MIT license).
""" """
from fritzconnection.lib.fritzstatus import FritzStatus
from linspector.core.service import Service from linspector.core.service import Service

View file

@ -3,7 +3,6 @@ This file is part of Linspector (https://linspector.org/)
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved. Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
See LICENSE.txt (MIT license). See LICENSE.txt (MIT license).
""" """
from fritzconnection.lib.fritzstatus import FritzStatus
from linspector.core.service import Service from linspector.core.service import Service

View file

@ -4,9 +4,10 @@ Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
See LICENSE.txt (MIT license). See LICENSE.txt (MIT license).
""" """
import calendar import calendar
import requests
import time import time
import requests
from linspector.core.service import Service from linspector.core.service import Service

View file

@ -4,9 +4,10 @@ Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
See LICENSE.txt (MIT license). See LICENSE.txt (MIT license).
""" """
import os import os
import paramiko
import pprint import pprint
import paramiko
from linspector.core.service import Service from linspector.core.service import Service
@ -36,4 +37,3 @@ class SSHService(Service):
for line in stdout: for line in stdout:
print('... ' + line.strip('\n')) print('... ' + line.strip('\n'))
client.close() client.close()

View file

@ -3,7 +3,6 @@ This file is part of Linspector (https://linspector.org/)
Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved. Copyright (c) 2022 Johannes Findeisen <you@hanez.org>. All Rights Reserved.
See LICENSE.txt (MIT license). See LICENSE.txt (MIT license).
""" """
from pysnmp.entity.rfc3413.oneliner import cmdgen
from linspector.core.service import Service from linspector.core.service import Service