Skip to content

Commit

Permalink
added warning when no messages are found for a channel during import
Browse files Browse the repository at this point in the history
  • Loading branch information
docmarionum1 committed Jan 27, 2020
1 parent e6db57b commit f04a6bb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions import.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
logger.info("Importing messages..")
for channel in channels:
files = glob.glob(os.path.join(directory, channel['name'], '*.json'))
if len(files) == 0:
logger.warning("No messages found for #%s" % channel['name'])
for file_name in files:
with open(file_name, encoding='utf8') as f:
messages = json.load(f)
Expand Down

0 comments on commit f04a6bb

Please sign in to comment.