diff --git a/converter.py b/converter.py new file mode 100755 index 0000000000000000000000000000000000000000..db2bb38cce63b5be846cb4da2cec631949971adb --- /dev/null +++ b/converter.py @@ -0,0 +1,19 @@ +import json +import glob +import os +# Basic converter to json, avec roles nounous partout + +init_path = '/home/dstan/crans/passwords/' +final_path = '/home/dstan/crans/passwords/v2/' + +os.chdir(init_path) + +filenames = glob.glob('*.asc') + +encoder=json.JSONEncoder() +for filename in filenames: + nf = file(final_path+filename[:-4]+'.json','w') + + nf.write(encoder.encode({'roles':['nounous']\ + ,'contents':open(filename).read()})) +