Skip to content
This repository was archived by the owner on Nov 11, 2019. It is now read-only.

Commit 091707a

Browse files
committed
Overhaul steve to use click
* rewrote steve to use click for subcommand structure, help text, argument parsing and output * redid entry points so that if steve throws an exception, it yields a helpful text for writing up an issue * added initial command line tests Two big reasons to switch to click are: 1. the structure for subcommands, options and arguments is a lot easier to put together, read and understand than what we had before 2. it's way easier to test command line handlers and we should be doing that more Fixes #32
1 parent 9b09afd commit 091707a

11 files changed

+360
-385
lines changed

docs/commandline.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ Example use
167167

168168
For example, if you use vim::
169169

170-
steve-cmd status --list | xargs vim
170+
steve-cmd status --aslist | xargs vim
171171

172172
and edit them by hand one-by-one.
173173

docs/installation.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ git clone and installing from that:
4242

4343
1. ``git clone git://github.com/pyvideo/steve.git``
4444
2. ``cd steve``
45-
3. ``python setup.py develop``
45+
3. ``pip install -r requirements.txt``
4646

4747
Update like this:
4848

@@ -60,7 +60,7 @@ do this:
6060
1. ``git clone git://github.com/pyvideo/steve.git``
6161
2. ``cd steve``
6262
3. ``virtualenv ./venv/``
63-
4. ``./venv/bin/python setup.py develop``
63+
4. ``./venv/bin/pip install -r requirements.txt``
6464

6565
When you want to use steve from your virtual environment, make sure to
6666
activate the virtual environment first. e.g.:

requirements.txt

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
-e .
22

3+
# Development requirements
34
Sphinx
4-
argparse
5-
blessings
6-
html2text
7-
requests
5+
click
86
flake8
97
pytest
108
tox

scripts/steve-cmd

-29
This file was deleted.

setup.py

+9-6
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
# license.
77
#######################################################################
88

9-
from setuptools import setup, find_packages
10-
import re
9+
from setuptools import find_packages, setup
1110
import os
11+
import re
1212

1313

1414
READMEFILE = 'README.rst'
@@ -39,16 +39,19 @@ def get_version():
3939
zip_safe=True,
4040
packages=find_packages(),
4141
include_package_data=True,
42-
scripts=['scripts/steve-cmd'],
4342
install_requires=[
44-
'argparse',
45-
'blessings',
43+
'click',
4644
'html2text',
4745
'jinja2',
4846
'requests',
4947
'pytest',
48+
'tabulate',
5049
'youtube-dl',
51-
],
50+
],
51+
entry_points="""
52+
[console_scripts]
53+
steve-cmd=steve.cmdline:click_run
54+
""",
5255
classifiers=[
5356
'Development Status :: 5 - Production/Stable',
5457
'Environment :: Console',

0 commit comments

Comments
 (0)