Take out logging. Also, add a exit option

Этот коммит содержится в:
drymer 2016-05-08 23:59:47 +02:00
родитель 32c308958f
Коммит e7c1efefe2
2 изменённых файлов: 8 добавлений и 8 удалений

Просмотреть файл

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

Просмотреть файл

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