More changes from gfm to md
This commit is contained in:
parent
f767b939ad
commit
60a65d227a
8
build.py
8
build.py
@ -72,7 +72,7 @@ def loaderRaw(var):
|
|||||||
|
|
||||||
def loaderMD(var):
|
def loaderMD(var):
|
||||||
fn = var.group(1)
|
fn = var.group(1)
|
||||||
db = shelve.open('build/GFM.dat')
|
db = shelve.open('build/MD.dat')
|
||||||
if db.has_key('files'):
|
if db.has_key('files'):
|
||||||
files = db['files']
|
files = db['files']
|
||||||
else:
|
else:
|
||||||
@ -88,12 +88,12 @@ def loaderMD(var):
|
|||||||
payload = {'text': file, 'mode': 'markdown'}
|
payload = {'text': file, 'mode': 'markdown'}
|
||||||
req = urllib2.Request(url)
|
req = urllib2.Request(url)
|
||||||
req.add_header('Content-Type', 'application/json')
|
req.add_header('Content-Type', 'application/json')
|
||||||
gfm = urllib2.urlopen(req, json.dumps(payload)).read().replace('\n', '').replace('\'', '\\\'')
|
md = urllib2.urlopen(req, json.dumps(payload)).read().replace('\n', '').replace('\'', '\\\'')
|
||||||
files[fn] = {}
|
files[fn] = {}
|
||||||
files[fn][filemd5] = gfm
|
files[fn][filemd5] = md
|
||||||
db['files'] = files
|
db['files'] = files
|
||||||
db.close()
|
db.close()
|
||||||
return gfm
|
return md
|
||||||
|
|
||||||
def loaderImage(var):
|
def loaderImage(var):
|
||||||
fn = var.group(1)
|
fn = var.group(1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user