From df57ecafed8e3cf56a74e5f95b578f5dae400f55 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 24 Dec 2016 12:41:49 -0800 Subject: improve display of help's description for p* scripts - Without ``formatter_class = argparse.RawDescriptionHelpFormatter``, whitespace is removed from the description, rendering it as a blob of text and less readable --- pyramid/scripts/pcreate.py | 7 +++++-- pyramid/scripts/prequest.py | 3 ++- pyramid/scripts/proutes.py | 3 ++- pyramid/scripts/pserve.py | 3 ++- pyramid/scripts/pshell.py | 3 ++- pyramid/scripts/ptweens.py | 1 + pyramid/scripts/pviews.py | 3 ++- 7 files changed, 16 insertions(+), 7 deletions(-) diff --git a/pyramid/scripts/pcreate.py b/pyramid/scripts/pcreate.py index 75e3b1fdc..cfab88160 100644 --- a/pyramid/scripts/pcreate.py +++ b/pyramid/scripts/pcreate.py @@ -23,13 +23,16 @@ def main(argv=sys.argv, quiet=False): class PCreateCommand(object): verbosity = 1 # required - parser = argparse.ArgumentParser(description="""\ + parser = argparse.ArgumentParser( + description="""\ Render Pyramid scaffolding to an output directory. Note: As of Pyramid 1.8, this command is deprecated. Use a specific cookiecutter instead: https://github.com/Pylons/?q=cookiecutter -""") +""", + formatter_class = argparse.RawDescriptionHelpFormatter, + ) parser.add_argument('-s', '--scaffold', dest='scaffold_name', action='append', diff --git a/pyramid/scripts/prequest.py b/pyramid/scripts/prequest.py index aefb4e18d..b74948289 100644 --- a/pyramid/scripts/prequest.py +++ b/pyramid/scripts/prequest.py @@ -47,7 +47,8 @@ class PRequestCommand(object): """ parser = argparse.ArgumentParser( - description=textwrap.dedent(description) + description=textwrap.dedent(description), + formatter_class = argparse.RawDescriptionHelpFormatter, ) parser.add_argument( '-n', '--app-name', diff --git a/pyramid/scripts/proutes.py b/pyramid/scripts/proutes.py index 2a999e04f..cd731946d 100644 --- a/pyramid/scripts/proutes.py +++ b/pyramid/scripts/proutes.py @@ -249,7 +249,8 @@ class PRoutesCommand(object): stdout = sys.stdout ConfigParser = configparser.ConfigParser # testing parser = argparse.ArgumentParser( - description=textwrap.dedent(description) + description=textwrap.dedent(description), + formatter_class = argparse.RawDescriptionHelpFormatter, ) parser.add_argument('-g', '--glob', action='store', diff --git a/pyramid/scripts/pserve.py b/pyramid/scripts/pserve.py index 845933c27..1f66394da 100644 --- a/pyramid/scripts/pserve.py +++ b/pyramid/scripts/pserve.py @@ -51,7 +51,8 @@ class PServeCommand(object): default_verbosity = 1 parser = argparse.ArgumentParser( - description=textwrap.dedent(description) + description=textwrap.dedent(description), + formatter_class = argparse.RawDescriptionHelpFormatter, ) parser.add_argument( '-n', '--app-name', diff --git a/pyramid/scripts/pshell.py b/pyramid/scripts/pshell.py index d8abf6619..d4b2db0ff 100644 --- a/pyramid/scripts/pshell.py +++ b/pyramid/scripts/pshell.py @@ -45,7 +45,8 @@ class PShellCommand(object): pkg_resources = pkg_resources # for testing parser = argparse.ArgumentParser( - description=textwrap.dedent(description) + description=textwrap.dedent(description), + formatter_class = argparse.RawDescriptionHelpFormatter, ) parser.add_argument('-p', '--python-shell', action='store', diff --git a/pyramid/scripts/ptweens.py b/pyramid/scripts/ptweens.py index f278a0370..076d44fa5 100644 --- a/pyramid/scripts/ptweens.py +++ b/pyramid/scripts/ptweens.py @@ -29,6 +29,7 @@ class PTweensCommand(object): """ parser = argparse.ArgumentParser( description=textwrap.dedent(description), + formatter_class = argparse.RawDescriptionHelpFormatter, ) parser.add_argument('config_uri', diff --git a/pyramid/scripts/pviews.py b/pyramid/scripts/pviews.py index 64408bdad..0d4c8e201 100644 --- a/pyramid/scripts/pviews.py +++ b/pyramid/scripts/pviews.py @@ -28,7 +28,8 @@ class PViewsCommand(object): stdout = sys.stdout parser = argparse.ArgumentParser( - description=textwrap.dedent(description) + description=textwrap.dedent(description), + formatter_class = argparse.RawDescriptionHelpFormatter, ) parser.add_argument('config_uri', -- cgit v1.2.3 From c9b2fa4d314e1d743a8e21c7b5ba85e1cb212e33 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 24 Dec 2016 12:47:00 -0800 Subject: PEP8 --- pyramid/scripts/pcreate.py | 2 +- pyramid/scripts/prequest.py | 2 +- pyramid/scripts/proutes.py | 2 +- pyramid/scripts/pserve.py | 2 +- pyramid/scripts/pshell.py | 2 +- pyramid/scripts/ptweens.py | 2 +- pyramid/scripts/pviews.py | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pyramid/scripts/pcreate.py b/pyramid/scripts/pcreate.py index cfab88160..a6db520ce 100644 --- a/pyramid/scripts/pcreate.py +++ b/pyramid/scripts/pcreate.py @@ -31,7 +31,7 @@ Note: As of Pyramid 1.8, this command is deprecated. Use a specific cookiecutter instead: https://github.com/Pylons/?q=cookiecutter """, - formatter_class = argparse.RawDescriptionHelpFormatter, + formatter_class=argparse.RawDescriptionHelpFormatter, ) parser.add_argument('-s', '--scaffold', dest='scaffold_name', diff --git a/pyramid/scripts/prequest.py b/pyramid/scripts/prequest.py index b74948289..66feff624 100644 --- a/pyramid/scripts/prequest.py +++ b/pyramid/scripts/prequest.py @@ -48,7 +48,7 @@ class PRequestCommand(object): parser = argparse.ArgumentParser( description=textwrap.dedent(description), - formatter_class = argparse.RawDescriptionHelpFormatter, + formatter_class=argparse.RawDescriptionHelpFormatter, ) parser.add_argument( '-n', '--app-name', diff --git a/pyramid/scripts/proutes.py b/pyramid/scripts/proutes.py index cd731946d..80c8238a2 100644 --- a/pyramid/scripts/proutes.py +++ b/pyramid/scripts/proutes.py @@ -250,7 +250,7 @@ class PRoutesCommand(object): ConfigParser = configparser.ConfigParser # testing parser = argparse.ArgumentParser( description=textwrap.dedent(description), - formatter_class = argparse.RawDescriptionHelpFormatter, + formatter_class=argparse.RawDescriptionHelpFormatter, ) parser.add_argument('-g', '--glob', action='store', diff --git a/pyramid/scripts/pserve.py b/pyramid/scripts/pserve.py index 1f66394da..e2d97f5ec 100644 --- a/pyramid/scripts/pserve.py +++ b/pyramid/scripts/pserve.py @@ -52,7 +52,7 @@ class PServeCommand(object): parser = argparse.ArgumentParser( description=textwrap.dedent(description), - formatter_class = argparse.RawDescriptionHelpFormatter, + formatter_class=argparse.RawDescriptionHelpFormatter, ) parser.add_argument( '-n', '--app-name', diff --git a/pyramid/scripts/pshell.py b/pyramid/scripts/pshell.py index d4b2db0ff..83e640c32 100644 --- a/pyramid/scripts/pshell.py +++ b/pyramid/scripts/pshell.py @@ -46,7 +46,7 @@ class PShellCommand(object): parser = argparse.ArgumentParser( description=textwrap.dedent(description), - formatter_class = argparse.RawDescriptionHelpFormatter, + formatter_class=argparse.RawDescriptionHelpFormatter, ) parser.add_argument('-p', '--python-shell', action='store', diff --git a/pyramid/scripts/ptweens.py b/pyramid/scripts/ptweens.py index 076d44fa5..5ca77e52a 100644 --- a/pyramid/scripts/ptweens.py +++ b/pyramid/scripts/ptweens.py @@ -29,7 +29,7 @@ class PTweensCommand(object): """ parser = argparse.ArgumentParser( description=textwrap.dedent(description), - formatter_class = argparse.RawDescriptionHelpFormatter, + formatter_class=argparse.RawDescriptionHelpFormatter, ) parser.add_argument('config_uri', diff --git a/pyramid/scripts/pviews.py b/pyramid/scripts/pviews.py index 0d4c8e201..4d3312917 100644 --- a/pyramid/scripts/pviews.py +++ b/pyramid/scripts/pviews.py @@ -29,7 +29,7 @@ class PViewsCommand(object): parser = argparse.ArgumentParser( description=textwrap.dedent(description), - formatter_class = argparse.RawDescriptionHelpFormatter, + formatter_class=argparse.RawDescriptionHelpFormatter, ) parser.add_argument('config_uri', -- cgit v1.2.3 From 5428bce2147e7f8cec503a3fb884b246e748b833 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 24 Dec 2016 12:47:12 -0800 Subject: add changelog entry --- CHANGES.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index 994aaec18..fcb5cbcbe 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -255,3 +255,6 @@ Documentation Changes See https://github.com/Pylons/pyramid/pull/2881 and https://github.com/Pylons/pyramid/pull/2883. + +- Improve output of p* script output of description for help. + See https://github.com/Pylons/pyramid/pull/2886 \ No newline at end of file -- cgit v1.2.3 From 0d5820c1c8aa8f0d355a1a875c89bf1c0207bcdf Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 24 Dec 2016 12:49:00 -0800 Subject: fix grammar of changelog entry --- CHANGES.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index fcb5cbcbe..218b2e412 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -256,5 +256,5 @@ Documentation Changes See https://github.com/Pylons/pyramid/pull/2881 and https://github.com/Pylons/pyramid/pull/2883. -- Improve output of p* script output of description for help. +- Improve output of p* script descriptions for help. See https://github.com/Pylons/pyramid/pull/2886 \ No newline at end of file -- cgit v1.2.3