Plugins code cleanup 0.1

This commit is contained in:
Jokob-sk
2023-09-01 08:04:14 +10:00
parent 015ce23fe2
commit 9afed6e43b
6 changed files with 85 additions and 199 deletions

View File

@@ -7,14 +7,16 @@ import argparse
import sys
sys.path.append("/home/pi/pialert/front/plugins")
sys.path.append('/home/pi/pialert/pialert')
from plugin_helper import Plugin_Objects
from plugin_helper import Plugin_Object, Plugin_Objects, decodeBase64
from logger import mylog, append_line_to_file
from helper import timeNowTZ
from const import logPath, pialertPath
CUR_PATH = str(pathlib.Path(__file__).parent.resolve())
LOG_FILE = os.path.join(CUR_PATH , 'script.log')
RESULT_FILE = os.path.join(CUR_PATH , 'last_result.log')
LOG_FILE = os.path.join(CUR_PATH, 'script.log')
RESULT_FILE = os.path.join(CUR_PATH, 'last_result.log')
def main():
@@ -23,6 +25,8 @@ def main():
parser.add_argument('devices', action="store", help="list of device names separated by ','")
values = parser.parse_args()
mylog('verbose', ['[UNDIS] In script'])
UNDIS_devices = Plugin_Objects( RESULT_FILE )
if values.devices: