63 lines
3.1 KiB
Python
63 lines
3.1 KiB
Python
# -*- coding: utf-8 -*- ############################################################### SOF
|
|
import irc3,os,threading,asyncio,ipdb
|
|
from time import sleep
|
|
from plugins.tool_dims_plugin import dims
|
|
from plugins.tool_guds_plugin import guds
|
|
from plugins.net_irc_plugin import config_ircbot
|
|
from plugins.net_irc_plugin import start_ircbot
|
|
from plugins.net_matrix_plugin import start_matrixbot
|
|
from plugins.tool_bus_plugin import BUS
|
|
##################################################channel##################################
|
|
class BOTIO:
|
|
#######################################################################################
|
|
verbosity=True
|
|
log_exit_level=[]
|
|
#######################################################################################
|
|
def __init__(self):
|
|
print(f'<<< ________botio_class >>> [ instantiated ]')
|
|
self.ircbot=config_ircbot()
|
|
self.net_irc=[]
|
|
self.net_matrix=[]
|
|
print(f'<<< ________botio_class >>> [ ircbot configured ]')
|
|
#######################################################################################
|
|
def __boot__irc(self):
|
|
print('<<< system_status__info >>> [ booting connection: irc ]')
|
|
self=start_ircbot(self)
|
|
#######################################################################################
|
|
def __boot__matrix(self):
|
|
print('<<< system_status__info >>> [ booting connection: matrix ]')
|
|
self=start_matrixbot(self)
|
|
#######################################################################################
|
|
def __boot__empty(self):
|
|
print('<<< system_status__info >>> [ booting connection: empty ]')
|
|
#######################################################################################
|
|
def __main__(self,index):
|
|
if index==0:
|
|
t=threading.Thread(target=self.__boot__irc)
|
|
print(f'<<< system_status__info >>> [ irc thread setup ]')
|
|
t.start()
|
|
print(f'<<< system_status__info >>> [ irc thread started ]')
|
|
elif index==1:
|
|
t=threading.Thread(target=self.__boot__matrix)
|
|
print(f'<<< system_status__info >>> [ matrix thread setup ]')
|
|
t.start()
|
|
t.join()
|
|
print(f'<<< system_status__info >>> [ matrix thread started ]')
|
|
# elif index==2:
|
|
# print(f'<<< system_status__info >>> [ empty thread setup ]')
|
|
# t=threading.Thread(target=self.__boot__empty)
|
|
# t.start()
|
|
# print(f'<<< system_status__info >>> [ empty thread started ]')
|
|
###########################################################################################
|
|
if __name__ == '__main__':
|
|
print('<<< system_status__info >>> [ main startup ]')
|
|
guds.add_credentials("@maple.or.g1mp:matrix.org")
|
|
guds.add_credentials("@maple:pcriot.org")
|
|
bio=BOTIO()
|
|
globals()['guds'].memories.append([bio,'maple:__main__.bio'])
|
|
for i in range(3):
|
|
bio.log_exit_level.append(bio.__main__(i))
|
|
while True:
|
|
if bio.verbosity: print('<<< system_status__info >>> [ eventloop idler thread ]')
|
|
sleep(1)
|
|
####################################################################################### EOF |