Add events: connect and disconnect
This commit is contained in:
BIN
deps/infra-0.1.tar.gz
vendored
Normal file
BIN
deps/infra-0.1.tar.gz
vendored
Normal file
Binary file not shown.
17
main.py
17
main.py
@@ -21,14 +21,7 @@ from pygost import gost34112012256
|
||||
import xml.etree.ElementTree as ET
|
||||
from reqs.request_xml_service import RequestXmlService
|
||||
import zipfile
|
||||
from libcommon import *
|
||||
from libdatabase import *
|
||||
from libgeodata import *
|
||||
from libgeodriver import *
|
||||
from libgeodesy import *
|
||||
from libgeom import *
|
||||
from libipdutilities import *
|
||||
from liboodriver import *
|
||||
from infra import *
|
||||
from config import Config
|
||||
from zip import Zip
|
||||
import boto3
|
||||
@@ -405,6 +398,12 @@ def onSent(params, files, callback_url):
|
||||
def onDelivered(params, files, callback_url):
|
||||
logger.warning('onDelivered')
|
||||
|
||||
def bnd_connected(bnd_name: str):
|
||||
logger.warning(f'{bnd_name} connected')
|
||||
|
||||
def bnd_disconnected(bnd_name: str):
|
||||
logger.warning(f'{bnd_name} disconnected')
|
||||
|
||||
|
||||
def main():
|
||||
logger.setLevel(logging.INFO)
|
||||
@@ -417,6 +416,8 @@ def main():
|
||||
server.register_function(accept)
|
||||
server.register_function(onSent)
|
||||
server.register_function(onDelivered)
|
||||
server.register_function(bnd_connected)
|
||||
server.register_function(bnd_disconnected)
|
||||
|
||||
thread = threading.Thread(target=run_tasks)
|
||||
thread.start()
|
||||
|
||||
Reference in New Issue
Block a user