fix debug

This commit is contained in:
Paolo Asperti 2018-01-15 22:34:25 +01:00
parent 4a6f66272a
commit 6adc5816f4

View File

@ -119,7 +119,7 @@ def processFile(filename):
if re.match(r'.*jpe?g$',filename):
for c in chat_ids:
try:
logger.debug('sending %s as picture to %s' % (filename,c['username']))
logger.info('sending %s as picture to %s' % (filename,c['username']))
r=bot.sendPhoto(c['id'], open(filename, 'rb'))
os.remove(filename)
logger.debug('removed %s' % filename)
@ -129,7 +129,7 @@ def processFile(filename):
for c in chat_ids:
try:
with open(filename,'r') as f:
logger.debug('sending %s as text to %s' % (filename,c['username']))
logger.info('sending %s as text to %s' % (filename,c['username']))
r=bot.sendMessage(c['id'], f.read())
os.remove(filename)
logger.debug('removed %s' % filename)
@ -161,7 +161,7 @@ class FilesChangedHandler(PatternMatchingEventHandler):
def checkFiles():
spool_dir = configParser.get('general', 'spool_dir')
logger.info('Checking %s for new files ...' % spool_dir)
logger.debug('Checking %s for new files ...' % spool_dir)
l=os.listdir(spool_dir)
for f in l:
processFile("%s/%s" % (spool_dir,f) )