Take out logging. Also, add a exit option

This commit is contained in:
drymer 2016-05-08 23:59:47 +02:00
parent 32c308958f
commit e7c1efefe2
2 changed files with 8 additions and 8 deletions

View File

@ -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

View File

@ -2,7 +2,7 @@
from setuptools import setup from setuptools import setup
VERSION = '0.1.2' VERSION = '0.1.3'
setup(name='jabbergram', setup(name='jabbergram',
version=VERSION, version=VERSION,