Add vmtp_genchart into pip console_scripts

Change-Id: I17fa14d7917cdcc1bae21c22b1bc57bd2faa2b79
This commit is contained in:
Yichen Wang 2015-08-11 16:38:44 -07:00
parent e67d767bb7
commit cb33958230
5 changed files with 11 additions and 6 deletions

1
.gitignore vendored
View File

@ -57,3 +57,4 @@ ChangeLog
# vmtp
*.local*
*.json
*.html

View File

@ -29,7 +29,7 @@ RHEL/CentOS based:
.. code-block:: bash
$ sudo yum install python-devel python-virtualenv git
# sudo yum install libxml2-devel libxslt-devel libffi-devel libyaml-devel openssl-devel
$ sudo yum install libxml2-devel libxslt-devel libffi-devel libyaml-devel openssl-devel
MacOSX:
@ -87,7 +87,7 @@ Super quick installation on RHEL/CentOS
.. code-block:: bash
$ sudo yum install python-devel python-virtualenv git
# sudo yum install libxml2-devel libxslt-devel libffi-devel libyaml-devel openssl-devel
$ sudo yum install libxml2-devel libxslt-devel libffi-devel libyaml-devel openssl-devel
$ # create a virtual environment
$ virtualenv ./vmtpenv
$ source ./vmtpenv/bin/activate

1
images
View File

@ -1 +0,0 @@
doc/source/images

View File

@ -31,6 +31,7 @@ package_data =
[entry_points]
console_scripts =
vmtp = vmtp.vmtp:main
vmtp_genchart = vmtp.vmtp_genchart:main
[build_sphinx]
source-dir = doc/source

10
vmtp/genchart.py → vmtp/vmtp_genchart.py Normal file → Executable file
View File

@ -1,3 +1,4 @@
#!/usr/bin/env python
# Copyright 2014 Cisco Systems, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
@ -232,11 +233,10 @@ def gen_chart(files, chart_dest, browser, protocols=''):
chart = GoogleChartsBarChart(results, protocols.lower())
chart.plot(chart_dest)
if browser:
url = 'file://' + os.path.abspath(opts.chart)
url = 'file://' + os.path.abspath(chart_dest)
webbrowser.open(url, new=2)
if __name__ == '__main__':
def main():
parser = argparse.ArgumentParser(description='VMTP Chart Generator V' + __version__)
parser.add_argument('-c', '--chart', dest='chart',
@ -271,3 +271,7 @@ if __name__ == '__main__':
sys.exit(0)
gen_chart(opts.files, opts.chart, opts.browser, opts.protocols)
if __name__ == '__main__':
main()