summaryrefslogtreecommitdiff
path: root/examples/table_display.py
Commit message (Collapse)AuthorAgeFilesLines
* Removed tableformatter example since cmd2 now has its own table creator ↵Kevin Van Brunt2020-04-211-204/+0
| | | | library and example program
* Removed unnecessary inheritance from objectKevin Van Brunt2020-02-041-1/+1
|
* Renamed ArgParser to Cmd2ArgumentParser to make it clear it's a derived ↵Kevin Van Brunt2019-07-181-3/+5
| | | | | | class of argparse.ArgumentParser when developers read the code in cmd2.py.
* Renamed Cmd2ArgParser to ArgParserKevin Van Brunt2019-07-121-3/+2
|
* Fixing examplesKevin Van Brunt2019-07-041-2/+3
|
* Simplified ansi color dictionaries and lookup methodsTodd Leonhardt2019-06-271-1/+2
| | | | | | | Also: - Updated examples that use color to use cmd2.ansi instead of colorama - Updated tests that use color to use cmd2.ansi instead of colorama - plumbum_colorspy example shows how to override color lookup functions to use a different color library
* Refactor exit_code implementationTodd Leonhardt2019-05-201-1/+2
| | | | | | | | | | | | cmd2.Cmd.cmdloop() now returns self.exit_code which should be an integer Also: - Refactored examples to call sys.exit(app.cmdloop()) in their __main__ - Running transcript tests now sets the exit_code accordingly based on success/failure - Updated CHANGELOG - Updated README - Updated Sphinx docs - Added unit test for case when transcript test fails
* Fix flake8 issuesTodd Leonhardt2018-12-061-4/+4
| | | | | | | | | | | | | | | | | | | | | | This commit contains a very large number of trivial changes in order to fix flake8 errors and warnings. Predominantly these are whitespace changes. Additionally, the build for Python 3.7 on TravisCI has been tweaked to fail if there are any flake8 errors using the following commandline: * flake8 . --count --ignore=E252 --max-complexity=31 --max-line-length=127 --show-source --statistics NOTE: In the future the max cyclomatic complexity should be lowered, but some improvements need to be made first. One flake8 error is being ignored entirely: * E252 missing whitespace around parameter equals * ignored because it doesn't correctly deal with default argument values after a type hint A few flake8 errors are being selectively ignored in certain files: * C901 fuction is too complex * ignored in argparse_completer.py because the complex code is an override of argparse complexity * E302 expected 2 blank lines after ... * ignored in all unit test files for convenience * F401 module imported but unused * ignored in cmd2/__init__.py because imports are for convenience of cmd2 developers and backwards compatibility * F821 undefined name * ignored in cmd2 script files which are intended to run only within cmd2 applications via pyscript where "app" and "cmd" are defined
* Added documentation stating that parsers passed to argparse decorators need ↵Todd Leonhardt2018-10-061-9/+17
| | | | | | | to be unique Also: - Modified table_display.py to demonstrate a workaround
* Removed remaining type hints in docstringsKevin Van Brunt2018-09-211-2/+2
|
* Rows with very high population density now have foreground text color set to redTodd Leonhardt2018-06-281-10/+28
|
* Made table more readable when colored module is installedTodd Leonhardt2018-06-271-1/+1
|
* Deleted unused constant for DEFAULT_GRIDTodd Leonhardt2018-06-271-19/+19
| | | | | | Also: - Improved some comments - Put the argparse args for selecting grid style in a mutually exclusive group
* table and object_table commands now accept argparse arguments for formatting ↵Todd Leonhardt2018-06-271-20/+28
| | | | the grid style
* Fixed table width for MumbaiTodd Leonhardt2018-06-271-2/+1
| | | | Changed to use Hindi name for Mumbai based on Google Translate instead of a Google search and the table width and underlying wide character width calculation appears to be working fine.
* Added city names in their native tongue in parentheses to demonstrate ↵Todd Leonhardt2018-06-261-17/+12
| | | | | | | unicode capability - Mandarin, Urdu, and Turkish all seem to be working fine - But something is up with Hindi - the table/colum width calculation is messed up for Mumbai
* Updating the example with unicode characters as well as demonstrating the ↵Eric Lin2018-06-261-21/+86
| | | | same table entries formatted as both an iterable of iterable as well as an iterable of objects.
* table_display.py example now uses tableformatter instead of tabulateTodd Leonhardt2018-06-261-17/+60
| | | | Changed the table_display.py example to use the tableformatter module which resuls in nicer looking tables.
* Standardize cmd2 imports in tests and exampleskotfu2018-05-231-1/+1
|
* Removed the expensive imports from cmd2/__init__.pyEric Lin2018-04-251-1/+1
| | | | | | | Added some shared definitions to cmd2/__init__.py -> maybe there's a better place for these? Figured out how to trick bash into showing argument hints. It's a bit weird. Updated all of the tests and examples to import cmd2 resources from their new location without the automatic imports in cmd2/__init__.py For #369
* Started removing dependency on sixTodd Leonhardt2018-04-151-1/+1
| | | | | | | Removed all dependency on six other than for six.moves.input Also: - Started removing code branches which were for Python 2 support
* Added table_display.pyTodd Leonhardt2018-03-141-0/+64
Added example showing how to display tabular data in a cmd2 application. Also: - Updated CHANGELOG with data on all PRs since last release - Bumped version to 0.8.2 in preparation for next release