[cli/util] fix requires to use the right stack frame, remove --print as "-" does the job
This commit is contained in:
@ -85,7 +85,6 @@ def execute(
|
|||||||
writer_option=None,
|
writer_option=None,
|
||||||
option=None,
|
option=None,
|
||||||
filter=None,
|
filter=None,
|
||||||
do_print=False
|
|
||||||
):
|
):
|
||||||
reader_factory, reader_option = resolve_factory(reader, input, READER, (option or []) + (reader_option or []))
|
reader_factory, reader_option = resolve_factory(reader, input, READER, (option or []) + (reader_option or []))
|
||||||
|
|
||||||
@ -121,7 +120,7 @@ def register(parser):
|
|||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--' + WRITER,
|
'--' + WRITER,
|
||||||
'-w',
|
'-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(
|
parser.add_argument(
|
||||||
'--filter',
|
'--filter',
|
||||||
@ -130,13 +129,6 @@ def register(parser):
|
|||||||
action='append',
|
action='append',
|
||||||
help='Add a filter between input and output',
|
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(
|
parser.add_argument(
|
||||||
'--option',
|
'--option',
|
||||||
'-O',
|
'-O',
|
||||||
|
|||||||
@ -11,7 +11,7 @@ class _RequiredModule:
|
|||||||
class _RequiredModulesRegistry(dict):
|
class _RequiredModulesRegistry(dict):
|
||||||
@property
|
@property
|
||||||
def pathname(self):
|
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):
|
def require(self, name):
|
||||||
if name not in self:
|
if name not in self:
|
||||||
|
|||||||
Reference in New Issue
Block a user