Ajout d'un converter initial
This commit is contained in:
parent
a3d0fee0df
commit
0026f5bc86
1 changed files with 19 additions and 0 deletions
19
converter.py
Executable file
19
converter.py
Executable file
|
@ -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()}))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue