work in progress
This commit is contained in:
parent
2778749f03
commit
fa732d6f17
|
@ -0,0 +1,63 @@
|
|||
# -*- 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
|
2
setup.sh
2
setup.sh
|
@ -14,4 +14,4 @@ echo "export CONSUMER_SECRET=514512521345234523452345234523452345234523452" >> .
|
|||
echo "export ACCESS_TOKEN_KEY=24513429875209348502934850294898348034850293485203948592" >> .venv/bin/activate
|
||||
echo "export ACCESS_TOKEN_SECRET=523490582034985203948520394804884820934850923485" >> .venv/bin/activate
|
||||
echo "export PYTHONASYNCIODEBUG=1" >> .venv/bin/activate
|
||||
pipenv run bot_maple.py
|
||||
pipenv run bot.py
|
||||
|
|
Loading…
Reference in New Issue