From dc59c88c3d52d51ee8f710a3d1c14ecbaff4e51e Mon Sep 17 00:00:00 2001 From: Romain Dorgueil Date: Fri, 13 Oct 2017 17:25:42 +0200 Subject: [PATCH] [cli/util] fix requires to use the right stack frame, remove --print as "-" does the job --- bonobo/commands/convert.py | 10 +--------- bonobo/util/python.py | 2 +- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/bonobo/commands/convert.py b/bonobo/commands/convert.py index 01441e4..2d13ab4 100644 --- a/bonobo/commands/convert.py +++ b/bonobo/commands/convert.py @@ -85,7 +85,6 @@ def execute( writer_option=None, option=None, filter=None, - do_print=False ): reader_factory, reader_option = resolve_factory(reader, input, READER, (option or []) + (reader_option or [])) @@ -121,7 +120,7 @@ def register(parser): parser.add_argument( '--' + WRITER, '-w', - help='Choose the writer factory if it cannot be detected from extension, or if detection is wrong.' + help='Choose the writer factory if it cannot be detected from extension, or if detection is wrong (use - for console pretty print).' ) parser.add_argument( '--filter', @@ -130,13 +129,6 @@ def register(parser): action='append', help='Add a filter between input and output', ) - parser.add_argument( - '--print', - '-p', - dest='do_print', - action='store_true', - help='Replace the output by a pretty printer.', - ) parser.add_argument( '--option', '-O', diff --git a/bonobo/util/python.py b/bonobo/util/python.py index e55c24c..8648f16 100644 --- a/bonobo/util/python.py +++ b/bonobo/util/python.py @@ -11,7 +11,7 @@ class _RequiredModule: class _RequiredModulesRegistry(dict): @property def pathname(self): - return os.path.join(os.getcwd(), os.path.dirname(inspect.getfile(inspect.stack()[1][0]))) + return os.path.join(os.getcwd(), os.path.dirname(inspect.getfile(inspect.stack()[2][0]))) def require(self, name): if name not in self: