Add setup.py support

This commit is contained in:
Matt Martz 2013-07-26 17:25:49 -05:00
parent f42e98f29f
commit acb1049463
2 changed files with 26 additions and 1 deletions

21
setup.py Normal file
View File

@ -0,0 +1,21 @@
#!/usr/bin/env python
import setuptools
setuptools.setup(
name='speedtest-cli',
version='0.2',
description=('Command line interface for testing internet bandwidth using '
'speedtest.net'),
author='Matt Martz',
author_email='matt@sivel.net',
url='https://github.com/sivel/speedtest-cli',
license='Apache License, Version 2.0',
py_modules=['speedtest_cli'],
entry_points={
'console_scripts': [
'speedtest=speedtest_cli:main',
'speedtest-cli=speedtest_cli:main'
]
}
)

View File

@ -517,10 +517,14 @@ def speedtest():
print_('Share results: http://www.speedtest.net/result/%s.png' % print_('Share results: http://www.speedtest.net/result/%s.png' %
resultid[0]) resultid[0])
if __name__ == '__main__':
def main():
try: try:
speedtest() speedtest()
except KeyboardInterrupt: except KeyboardInterrupt:
print_('\nCancelling...') print_('\nCancelling...')
if __name__ == '__main__':
main()
# vim:ts=4:sw=4:expandtab # vim:ts=4:sw=4:expandtab