Skip to content

Commit

Permalink
[meetbot] Slugify meeting titles before making file names
Browse files Browse the repository at this point in the history
It could be done more properly, but it fixes issue sopel-irc#225, so it'll do for now.
  • Loading branch information
embolalia committed May 9, 2013
1 parent 9b8094f commit 6bf865f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion meetbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ def figure_logfile_name(channel):
name = 'untitled'
else:
name = meetings_dict[channel]['title']
name = name.replace(' ', '-')
# Real simple sluggifying. This bunch of characters isn't exhaustive, but
# whatever. It's close enough for most situations, I think.
for c in ' ./\\:*?"<>|&*`':
name = name.replace(c, '-')
timestring = time.strftime('%Y-%m-%d-%H:%M', time.gmtime(meetings_dict[channel]['start']))
filename = timestring + '_' + name
return filename
Expand Down

0 comments on commit 6bf865f

Please sign in to comment.