Use already read file instead of rereading

This commit is contained in:
Kevin 2013-04-16 20:22:09 -07:00
parent ae8200d7be
commit d59e2e2816

View File

@ -85,7 +85,7 @@ def loaderGFM(var):
return files[fn][filemd5]
else:
url = 'https://api.github.com/markdown'
payload = {'text': readfile(fn), 'mode': 'gfm', 'context': 'jonatkins/ingress-intel-total-conversion'}
payload = {'text': file, 'mode': 'gfm', 'context': 'jonatkins/ingress-intel-total-conversion'}
req = urllib2.Request(url)
req.add_header('Content-Type', 'application/json')
gfm = urllib2.urlopen(req, json.dumps(payload)).read().replace('\n', '').replace('\'', '\\\'')