diff options
author | Doug Hellmann <doug.hellmann@dreamhost.com> | 2012-06-20 17:27:08 -0400 |
---|---|---|
committer | Doug Hellmann <doug.hellmann@dreamhost.com> | 2012-06-20 17:27:08 -0400 |
commit | 83469ad81a27f0b264bd93904b2b172fd889cad9 (patch) | |
tree | 5767811612dbf0c0918b4d798bacc56cb5120283 /docs/source | |
parent | 9bb0a4a13acfce6a0924514b883417875a1143dc (diff) | |
download | cliff-tablib-83469ad81a27f0b264bd93904b2b172fd889cad9.tar.gz |
Doc updates for API changes.
Clean up docstrings.
Bump version to 1.0.
Change-Id: I1047c637ffed4ffac8bffbdaa1bddc56895716d9
Diffstat (limited to 'docs/source')
-rw-r--r-- | docs/source/conf.py | 2 | ||||
-rw-r--r-- | docs/source/demoapp.rst | 16 | ||||
-rw-r--r-- | docs/source/history.rst | 8 | ||||
-rw-r--r-- | docs/source/introduction.rst | 2 | ||||
-rw-r--r-- | docs/source/list_commands.rst | 12 | ||||
-rw-r--r-- | docs/source/show_commands.rst | 9 |
6 files changed, 31 insertions, 18 deletions
diff --git a/docs/source/conf.py b/docs/source/conf.py index 9f71445..9e4b98e 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -48,7 +48,7 @@ copyright = u'2012, Doug Hellmann' # built documents. # # The short X.Y version. -version = '0.7' +version = '1.0' # The full version, including alpha/beta/rc tags. release = version diff --git a/docs/source/demoapp.rst b/docs/source/demoapp.rst index 84ca5d3..66e66cb 100644 --- a/docs/source/demoapp.rst +++ b/docs/source/demoapp.rst @@ -155,19 +155,25 @@ features of cliff. causing error this is the expected exception Traceback (most recent call last): - File ".../cliff/app.py", line 148, in run + File ".../cliff/app.py", line 218, in run_subcommand result = cmd.run(parsed_args) - File ".../demoapp/cliffdemo/simple.py", line 24, in run + File ".../cliff/command.py", line 43, in run + self.take_action(parsed_args) + File ".../demoapp/cliffdemo/simple.py", line 24, in take_action raise RuntimeError('this is the expected exception') RuntimeError: this is the expected exception Traceback (most recent call last): File "/Users/dhellmann/Envs/cliff/bin/cliffdemo", line 9, in <module> load_entry_point('cliffdemo==0.1', 'console_scripts', 'cliffdemo')() - File ".../demoapp/cliffdemo/main.py", line 30, in main + File ".../demoapp/cliffdemo/main.py", line 33, in main return myapp.run(argv) - File ".../cliff/app.py", line 148, in run + File ".../cliff/app.py", line 160, in run + result = self.run_subcommand(remainder) + File ".../cliff/app.py", line 218, in run_subcommand result = cmd.run(parsed_args) - File ".../demoapp/cliffdemo/simple.py", line 24, in run + File ".../cliff/command.py", line 43, in run + self.take_action(parsed_args) + File ".../demoapp/cliffdemo/simple.py", line 24, in take_action raise RuntimeError('this is the expected exception') RuntimeError: this is the expected exception diff --git a/docs/source/history.rst b/docs/source/history.rst index 8775e0d..e391488 100644 --- a/docs/source/history.rst +++ b/docs/source/history.rst @@ -2,11 +2,17 @@ Release History ================= -dev +1.0 - Add trailing newlines after output from tablib-based formatters (JSON, YAML, and HTML). Contributed by Matt Joyce. - Some :pep:`8` fixes. + - Refactor the API in :class:`Command` to add :func:`take_action` + and make :func:`run` a concrete method. Existing users should only + need to rename :func:`run()` to :func:`take_action()` since the + function signatures have not changed. + - In :class:`Lister` and :class:`ShowOne` use :func:`take_action` + instead of :func:`get_data`. 0.7 diff --git a/docs/source/introduction.rst b/docs/source/introduction.rst index 0951f19..d9312b9 100644 --- a/docs/source/introduction.rst +++ b/docs/source/introduction.rst @@ -48,7 +48,7 @@ discover the command plugins and invoke them, and to provide runtime support for those plugins. Each :class:`Command` subclass is responsible for taking action based on instructions from the user. It defines its own local argument parser (usually using argparse_) and a -:func:`run` method that does the appropriate work. +:func:`take_action` method that does the appropriate work. The Interactive Application --------------------------- diff --git a/docs/source/list_commands.rst b/docs/source/list_commands.rst index d4e697c..f76188b 100644 --- a/docs/source/list_commands.rst +++ b/docs/source/list_commands.rst @@ -12,12 +12,12 @@ Lister ====== The :class:`cliff.lister.Lister` base class API extends -:class:`Command` to add a :func:`get_data` method. Subclasses should -provide a :func:`get_data` implementation that returns a two member -tuple containing a tuple with the names of the columns in the dataset -and an iterable that will yield the data to be output. See the -description of :ref:`the files command in the demoapp <demoapp-list>` -for details. +:class:`Command` to allow :func:`take_action` to return data to be +formatted using a user-selectable formatter. Subclasses should provide +a :func:`take_action` implementation that returns a two member tuple +containing a tuple with the names of the columns in the dataset and an +iterable that will yield the data to be output. See the description of +:ref:`the files command in the demoapp <demoapp-list>` for details. List Output Formatters ====================== diff --git a/docs/source/show_commands.rst b/docs/source/show_commands.rst index 0aa7d9f..e848960 100644 --- a/docs/source/show_commands.rst +++ b/docs/source/show_commands.rst @@ -12,10 +12,11 @@ ShowOne ======= The :class:`cliff.show.ShowOne` base class API extends -:class:`Command` to add a :func:`get_data` method. Subclasses should -provide a :func:`get_data` implementation that returns a two member -tuple containing a tuple with the names of the columns in the dataset -and an iterable that contains the data values associated with those +:class:`Command` to allow :func:`take_action` to return data to be +formatted using a user-selectable formatter. Subclasses should provide +a :func:`take_action` implementation that returns a two member tuple +containing a tuple with the names of the columns in the dataset and an +iterable that contains the data values associated with those names. See the description of :ref:`the file command in the demoapp <demoapp-show>` for details. |