Add setup.py, addresses #9

This commit is contained in:
Matt Martz 2013-07-30 21:45:46 -05:00
commit 4b06259a92
3 changed files with 60 additions and 1 deletions

View File

@ -6,6 +6,40 @@ Command line interface for testing internet bandwidth using speedtest.net
speedtest-cli works with Python 2.4-3.3
## Installation
### pip / easy_install
`pip install speedtest-cli`
or
`easy_install speedtest-cli`
### Github
`pip install git+https://github.com/sivel/speedtest-cli.git`
or
```shell
git clone https://github.com/sivel/speedtest-cli.git
python speedtest-cli/setup.py
```
### Just download (just like the way it was)
```shell
wget -O speedtest-cli https://github.com/sivel/speedtest-cli/raw/master/speedtest_cli.py
chmod +x speedtest-cli
```
or
```shell
curl -o speedtest-cli https://github.com/sivel/speedtest-cli/raw/master/speedtest_cli.py
chmod +x speedtest-cli
```
## Usage

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' %
resultid[0])
if __name__ == '__main__':
def main():
try:
speedtest()
except KeyboardInterrupt:
print_('\nCancelling...')
if __name__ == '__main__':
main()
# vim:ts=4:sw=4:expandtab