Take out logging. Also, add a exit option
This commit is contained in:
parent
32c308958f
commit
e7c1efefe2
|
@ -10,6 +10,7 @@ from queue import Queue
|
||||||
from telegram.error import NetworkError, Unauthorized
|
from telegram.error import NetworkError, Unauthorized
|
||||||
from time import sleep
|
from time import sleep
|
||||||
from sys import argv
|
from sys import argv
|
||||||
|
from sys import exit
|
||||||
|
|
||||||
|
|
||||||
class EchoBot(sleekxmpp.ClientXMPP):
|
class EchoBot(sleekxmpp.ClientXMPP):
|
||||||
|
@ -30,13 +31,12 @@ class EchoBot(sleekxmpp.ClientXMPP):
|
||||||
t = Thread(target=self.read_tg)
|
t = Thread(target=self.read_tg)
|
||||||
t.daemon = True
|
t.daemon = True
|
||||||
t.start()
|
t.start()
|
||||||
|
print('Please wait a couple of minutes until it\'s correctly connected'
|
||||||
# activar logueo basico
|
' to telegram.')
|
||||||
logging.basicConfig(
|
while True:
|
||||||
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
|
out = input('Enter "quit" if you want to stop the program.\n')
|
||||||
level=logging.INFO)
|
if out == 'quit':
|
||||||
|
exit()
|
||||||
logger = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
def read_tg(self):
|
def read_tg(self):
|
||||||
update_id = 0
|
update_id = 0
|
||||||
|
|
Loading…
Reference in New Issue