Commit Graph

37 Commits

Author SHA1 Message Date
Stephen Finucane 13424d1214 Fix pre-commit issues
Mostly trailing spaces.

Change-Id: I3cde0f4bc51bdeb3e82859a131f866728234c9ad
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2023-09-05 10:17:38 +01:00
xuanyandong 0d18e8812c Remove unicode from code
Change-Id: I040fccd1714dccd7a87aaf10d397ad3a3ef476d3
2021-01-28 17:00:45 +00:00
Stephen Finucane 37e53cad85 trivial: Remove references to Python 2.7
There were some in both the docs and the demo application.

Change-Id: I58d14cd3a372f9bdf617cbfbcb5ce34169ac83f8
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2020-11-18 18:06:04 +00:00
Stephen Finucane f3587efee8 Remove references to setuptools
With the advent of importlib, entry points are no long a setuptools-only
thing. Update the docs to reflect that.

Change-Id: I099f397ddb4d71879597cfe67ef2a1eff4a8d1af
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2020-10-22 10:30:15 +01:00
Sorin Sbarnea 1e4d3aa605
Assure executable name is kept when app is called as module
- Detects module name if needed
- Updates demoapp

Change-Id: Ie0cd9d507fcb4c32ab98e51f61741d529ff41cac
Closes-Bug: 1779218
Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
2018-06-28 22:57:31 +01:00
Doug Hellmann 95c749d55e add before and after hooks
Add hooks that are called before and after the take_action() method of
the command.

Change-Id: Id6527dfe0946c0ab169fc165b84d40f3ff95e08c
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-06-30 09:50:21 -04:00
Doug Hellmann 45de8e45ef add hook for get_epilog
Change-Id: If3fe077522c156472a0213e8768470e0505c189d
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-06-30 09:50:12 -04:00
Doug Hellmann e72e54e757 add hook for manipulating the argument parser
Update Commands to load a separate set of extensions to be used as
"hooks," triggered at different points in the processing of the
command. Start with a hook that is given access to the argument parser
for the command so it can modify it.

Change-Id: I0785548fd36a61cda616921a4a21be3f67701300
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-06-30 09:50:07 -04:00
Masayuki Igawa f7c9713c53 Fix cliff URLs in doc and demoapp
This commit fixes cliff URLs in the documents and demoapp.

Change-Id: I5a190841d1126119eddacedd02667efd52709330
2016-07-28 16:08:47 +09:00
Doug Hellmann 79e05f6bdc Set demo app up with deferred help
Change-Id: Ia48866e17d5823a2ccc85172c717581316ad05a7
2015-07-24 15:44:06 +00:00
Doug Hellmann b9f5954b77 Fix logging config in demo app
The demo application was creating a new logger instance instead of using
the one built into the base class.

Change-Id: I980b180132cf20f7d2420e8f61e341760674aac0
2015-07-09 20:15:01 +00:00
Doug Hellmann 6a35ba1b0d Update pyparsing dependency to 2.0.1
Go ahead and require the version of pyparsing that supports
python 2 and 3.

Change-Id: Icdeb7c4a4aeaab9fcc4a44b091a068f91553adf6
2013-09-23 15:45:23 -04:00
Doug Hellmann 852a729fbb remove use of distribute in demo app
Change-Id: I3bbd270a2a0ed6eee6eb12a326f86aaad84f2aad
2013-08-12 14:48:02 -04:00
Doug Hellmann aa6bb0cfe3 Fix default encoding issue with python 2.6
This change addresses issue #38: "fix unicode handling issues".

The issue was originally reported against neutron client
(https://bugs.launchpad.net/python-neutronclient/+bug/1189112) but
was tracked down to the fact that python 2.6 does not set the default
encoding for sys.stdout properly. A change to python 2.7 fixes the
problem there and later (http://hg.python.org/cpython/rev/e60ef17561dc/),
but since cliff supports python 2.6 it needs to handle the case
explicitly.

Change-Id: Id06507d78c7c82b25f39366ea4a6dfa4ef3a3a97
2013-08-12 14:45:23 -04:00
qneill c812297ef1 Fix typo. 2013-01-03 21:38:50 -06:00
Doug Hellmann 83469ad81a Doc updates for API changes.
Clean up docstrings.
Bump version to 1.0.

Change-Id: I1047c637ffed4ffac8bffbdaa1bddc56895716d9
2012-06-20 17:27:08 -04:00
Doug Hellmann 748ef2b230 Refactor DisplayBase.run() to make it easier to override separate parts in subclasses.
Rename get_data() to take_action() so subclasses that do something other than query for values have a clear place to override.
2012-06-01 10:54:18 -04:00
Doug Hellmann 0be17dec6b declare a couple of commands that use builtin command names but use multiple words 2012-05-14 17:32:23 -04:00
Doug Hellmann 921708980b pass more details to initialize_app so subclasses can decide what sort of initialization to do 2012-05-10 14:58:18 -04:00
Doug Hellmann 0fba728779 simplify packaging file for demo app 2012-04-28 19:37:23 -04:00
Doug Hellmann b17d091258 first pass at interactive app 2012-04-28 19:37:22 -04:00
Doug Hellmann 16c1759f81 add longer docstring to show how it is printed by help 2012-04-28 11:07:37 -04:00
Doug Hellmann 556495e530 add ShowOne base class for commands that need to show properties of an individual object
make the table formatter work as a single object formatter
update the docs for the new features
2012-04-27 19:56:45 -04:00
Doug Hellmann 955b29a96b remove example that I was using as a syntax reminder 2012-04-25 17:01:35 -04:00
Duncan McGreggor e8e7404eb1 Added a bit more to the README. 2012-04-23 10:32:14 -04:00
Doug Hellmann 3a533e4f3f flesh out instructions for using the demo app 2012-04-23 07:22:33 -07:00
Duncan McGreggor 9e4be06b20 Added a README for the demo app. 2012-04-23 10:07:04 -04:00
Duncan McGreggor 42cbb39d14 Added download url to both setup.py files and updated the demo setup.py with
the new url.
2012-04-23 09:59:32 -04:00
Duncan McGreggor cf25991f26 Added missing distribute setup file. 2012-04-23 09:45:44 -04:00
Doug Hellmann 6b4add15ab start creating a subclass of command for producing a list of output in different formats, using prettytable as an example formatter 2012-04-22 16:15:37 -07:00
Doug Hellmann 6fdfe6dbf1 Pass the I/O streams into the app 2012-04-22 15:21:02 -07:00
Doug Hellmann 276e8a4694 add some error handling to App 2012-04-22 15:14:02 -07:00
Doug Hellmann 35f42f9f8b tweak App api to make it easier to override and perform global actions before and after a command runs 2012-04-22 15:03:15 -07:00
Doug Hellmann 21b06cd2be use logging for controlling console output verbosity 2012-04-21 08:01:57 -07:00
Doug Hellmann 6f1f61eb34 clean up argv handling 2012-04-20 22:27:45 -07:00
Doug Hellmann 417c4f7bac replace default --help processor with one that includes the list of subcommands available 2012-04-20 22:20:17 -07:00
Doug Hellmann b3ce7441a3 Sample program with command plugins 2012-04-20 17:34:10 -07:00