Skip to content

Commit

Permalink
Added plugin loading log
Browse files Browse the repository at this point in the history
  • Loading branch information
cganterh committed Jul 3, 2017
1 parent 3580c41 commit d6187ae
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions le.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,14 @@ def run():
updater = Updater(token=args.telegram_token)

entry_points_iterator = iter_entry_points('le.handlers')
handlers = (ep.load() for ep in entry_points_iterator)
handlers = ((ep.name, ep.load()) for ep in entry_points_iterator)

for handler in handlers:
for name, handler in handlers:
updater.dispatcher.add_handler(handler)

logging.getLogger().debug(
'Loaded {}: {}'.format(name, handler)
)

updater.start_polling()
updater.idle()

0 comments on commit d6187ae

Please sign in to comment.