pedantic whitespace changes

This commit is contained in:
Bryan Bishop 2013-01-10 17:14:41 -06:00
parent aa98a92edb
commit b09a55c06e

View File

@ -45,7 +45,7 @@ def download(phenny, input, verbose=True):
headers = { headers = {
"Content-Type": "application/json", "Content-Type": "application/json",
} }
data = { data = {
"url": line, "url": line,
"sessionid": "what" "sessionid": "what"
@ -60,7 +60,7 @@ def download(phenny, input, verbose=True):
content = json.loads(response.content) content = json.loads(response.content)
item = content[0] item = content[0]
title = item["title"] title = item["title"]
if item.has_key("attachments"): if item.has_key("attachments"):
pdf_url = None pdf_url = None
for attachment in item["attachments"]: for attachment in item["attachments"]:
@ -102,7 +102,7 @@ def download(phenny, input, verbose=True):
filename = requests.utils.quote(title) filename = requests.utils.quote(title)
url = "http://diyhpl.us/~bryan/papers2/paperbot/" + filename + ".pdf" url = "http://diyhpl.us/~bryan/papers2/paperbot/" + filename + ".pdf"
phenny.say(url) phenny.say(url)
return return
elif verbose and explicit: elif verbose and explicit:
@ -141,7 +141,7 @@ def download_ieee(url):
def download_url(url): def download_url(url):
response = requests.get(url, headers={"User-Agent": "origami-pdf"}) response = requests.get(url, headers={"User-Agent": "origami-pdf"})
content = response.content content = response.content
title = "%0.2x" % random.getrandbits(128) title = "%0.2x" % random.getrandbits(128)
path = os.path.join("/home/bryan/public_html/papers2/paperbot/", title) path = os.path.join("/home/bryan/public_html/papers2/paperbot/", title)