From acb1049463942c9d727d42cb47cd7a2e511804ac Mon Sep 17 00:00:00 2001 From: Matt Martz Date: Fri, 26 Jul 2013 17:25:49 -0500 Subject: [PATCH 1/3] Add setup.py support --- setup.py | 21 +++++++++++++++++++++ speedtest-cli => speedtest_cli.py | 6 +++++- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 setup.py rename speedtest-cli => speedtest_cli.py (99%) diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..c460143 --- /dev/null +++ b/setup.py @@ -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' + ] + } +) diff --git a/speedtest-cli b/speedtest_cli.py similarity index 99% rename from speedtest-cli rename to speedtest_cli.py index 559898a..0043851 100755 --- a/speedtest-cli +++ b/speedtest_cli.py @@ -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 From 4a6257069ee53e2b6a022c75fccb531671182b5c Mon Sep 17 00:00:00 2001 From: Matt Martz Date: Sun, 28 Jul 2013 17:25:19 -0500 Subject: [PATCH 2/3] s/if args.mini/elif args.mini/ --- speedtest_cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/speedtest_cli.py b/speedtest_cli.py index 0043851..e380603 100755 --- a/speedtest_cli.py +++ b/speedtest_cli.py @@ -408,7 +408,7 @@ def speedtest(): except IndexError: print_('Invalid server ID') sys.exit(1) - if args.mini: + elif args.mini: name, ext = os.path.splitext(args.mini) if ext: url = os.path.dirname(args.mini) From 2f0027c478e2c23906545f977d6a77c025a06342 Mon Sep 17 00:00:00 2001 From: Matt Martz Date: Tue, 30 Jul 2013 21:39:24 -0500 Subject: [PATCH 3/3] Add installation info to README.md --- README.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/README.md b/README.md index 77f5839..55ebbcf 100644 --- a/README.md +++ b/README.md @@ -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