Add dst svg file generation parameter for cli
This commit is contained in:
parent
f308f2913f
commit
62ccd164ff
@ -37,7 +37,12 @@ cli_opts = [
|
||||
'hw-info',
|
||||
required=True,
|
||||
help='Hardware information'
|
||||
)
|
||||
),
|
||||
cfg.StrOpt(
|
||||
'svg-file',
|
||||
required=True,
|
||||
help='Svg file is required for svg viewer'
|
||||
),
|
||||
]
|
||||
|
||||
|
||||
@ -75,7 +80,7 @@ def parse_configs(conf):
|
||||
|
||||
def save_result(data, output_file):
|
||||
viewer.StdoutViewer(data).show_me()
|
||||
viewer.SVGViewer(data).show_me()
|
||||
viewer.SVGViewer(data, file_path=output_file).show_me()
|
||||
|
||||
|
||||
def validate_schema(schema):
|
||||
@ -96,7 +101,7 @@ def allocator():
|
||||
|
||||
schema = DynamicAllocator(*conf).generate_static()
|
||||
|
||||
save_result(schema, CONF.file)
|
||||
save_result(schema, CONF.svg_file)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
2
run.sh
2
run.sh
@ -3,4 +3,4 @@
|
||||
export LC_ALL=en_US.UTF-8
|
||||
export LANG=en_US.UTF-8
|
||||
|
||||
python bareon_dynamic_allocator/cmd.py --debug --schema etc/bareon-dynamic-allocator/simple_schema.yaml --file o.txt --hw-info etc/bareon-dynamic-allocator/example_2_disks.yaml
|
||||
python bareon_dynamic_allocator/cmd.py --svg-file /tmp/bareon.svg --debug --schema etc/bareon-dynamic-allocator/simple_schema.yaml --file o.txt --hw-info etc/bareon-dynamic-allocator/example_2_disks.yaml
|
||||
|
Loading…
Reference in New Issue
Block a user