launcher/test.py

29 lines
1.0 KiB
Python

# Copyright (c) 20.09.25, 14:06. a.jurcenko@inproduct.de
import datetime
import time
from task import SystemTask, GETTask, ConsolePrintTask
from events import TimeEvent, DirectoryWatchEvent
#
# t1 = SystemTask(name='test', destination="ls", arguments='-la')
# t1.execute()
#
# t2 = SystemTask(name='pip', destination="python3", arguments='-m pip', on_success=lambda: print('sehr gut'), on_failure=lambda: print('schlecht'))
# t2.execute()
#
# t3 = GETTask(name='get_inproduct', destination="http://google.de", on_success=lambda: print('sehr gut'), on_failure=lambda: print('schlecht'))
#
#
# t4 = GETTask(name='get_google', destination="https://google.de", on_success=t3.execute, on_failure=lambda: print('schlecht'))
# t4.execute()
#
# now = datetime.datetime.now()
# now = now + datetime.timedelta(minutes=1)
# te = TimeEvent('test_event', time=now, task=t1)
#
# while True:
# te.check_conditions()
dwe = DirectoryWatchEvent(task=ConsolePrintTask(name='test'), directory='/home/alex/test')
while True:
dwe.check_conditions()