Commit 8eb2e3e2 authored by Daniel Stan's avatar Daniel Stan

converter n'écrase plus

parent 0026f5bc
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
import json
import glob
import os
import os,sys
# Basic converter to json, avec roles nounous partout
init_path = '/home/dstan/crans/passwords/'
......@@ -12,7 +15,13 @@ filenames = glob.glob('*.asc')
encoder=json.JSONEncoder()
for filename in filenames:
nf = file(final_path+filename[:-4]+'.json','w')
fname=final_path+filename[:-4]+'.json'
if os.path.exists(fname):
print "%s already exists, ignored" % filename
continue
else:
print "Traitement de %s" % filename
nf = file(fname,'w')
nf.write(encoder.encode({'roles':['nounous']\
,'contents':open(filename).read()}))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment