From 5fbeedd76b36cea26dc3ecc51cb936f7ae5a9c2c Mon Sep 17 00:00:00 2001 From: Bryan Bishop Date: Sat, 9 Feb 2013 19:22:51 -0600 Subject: [PATCH] remove extra periods from filenames --- modules/papers.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/papers.py b/modules/papers.py index dd2a865..f2a6fa5 100644 --- a/modules/papers.py +++ b/modules/papers.py @@ -113,6 +113,12 @@ def download(phenny, input, verbose=True): file_handler.close() filename = requests.utils.quote(title) + + # Remove an ending period, which sometimes happens when the + # title of the paper has a period at the end. + if filename[-1] == ".": + filename = filename[:-1] + url = "http://diyhpl.us/~bryan/papers2/paperbot/" + filename + ".pdf" phenny.say(url)