Add destination directory argument and write content instead of piping.
This commit is contained in:
parent
9a85fd0c97
commit
1b0e830e16
|
@ -28,6 +28,9 @@ parser.add_argument('-g', '--gateway', action='append',
|
|||
|
||||
parser.add_argument('batmanjson', help='output of batman vd json')
|
||||
|
||||
parser.add_argument('-d', '--destination-directory', action='store',
|
||||
help='destination directory for generated files',required=True)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
options = vars(args)
|
||||
|
@ -44,4 +47,6 @@ if options['gateway']:
|
|||
|
||||
m = D3MapBuilder(db)
|
||||
|
||||
print(m.build())
|
||||
nodes_json = open(options['destination_directory'] + '/nodes.json.new','w')
|
||||
nodes_json.write(m.build())
|
||||
nodes_json.close()
|
||||
|
|
2
mkmap.sh
2
mkmap.sh
|
@ -20,7 +20,7 @@ fi
|
|||
"$(dirname "$0")"/ffhlwiki.py http://freifunk.metameute.de/wiki/Knoten > "$(dirname "$0")"/aliases_hl.json
|
||||
"$(dirname "$0")"/ffhlwiki.py http://freifunk.metameute.de/wiki/Moelln:Knoten > "$(dirname "$0")"/aliases_moelln.json
|
||||
|
||||
batctl vd json -n | "$(dirname "$0")"/bat2nodes.py -a "$(dirname "$0")"/aliases.json -a aliases_hl.json -a aliases_moelln.json $GWS - > $DEST/nodes.json.new
|
||||
batctl vd json -n | "$(dirname "$0")"/bat2nodes.py -a "$(dirname "$0")"/aliases.json -a aliases_hl.json -a aliases_moelln.json -d $DEST $GWS -
|
||||
|
||||
mv $DEST/nodes.json.new $DEST/nodes.json
|
||||
|
||||
|
|
Loading…
Reference in a new issue