10 if not os.path.exists(n): os.mkdir(n)
12 dst = os.path.dirname(fname)
13 name = os.path.basename(fname).split('.')[0]
15 dst2 = os.path.join(dst, name)
18 data = json.load(open(fname))
20 dst3 = os.path.join(dst2, ip['fields']['slug'])
22 for fld, val in ip['fields'].items():
25 if filter(lambda x: fld.startswith(x),
26 ['title', 'left_column', 'right_column']):
27 o = open(os.path.join(dst3, fld+".txt"),'w')
29 o.write(val.encode('utf-8'))