Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#444: Removed pipes dependency #447

Merged
merged 1 commit into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 2 additions & 3 deletions fire/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ def main(argv):
import inspect
import json
import os
import pipes
import re
import shlex
import sys
Expand Down Expand Up @@ -238,7 +237,7 @@ def _IsHelpShortcut(component_trace, remaining_args):
component_trace.show_help = True
command = '{cmd} -- --help'.format(cmd=component_trace.GetCommand())
print('INFO: Showing help with the command {cmd}.\n'.format(
cmd=pipes.quote(command)), file=sys.stderr)
cmd=shlex.quote(command)), file=sys.stderr)
return show_help


Expand Down Expand Up @@ -294,7 +293,7 @@ def _DisplayError(component_trace):
if show_help:
command = '{cmd} -- --help'.format(cmd=component_trace.GetCommand())
print('INFO: Showing help with the command {cmd}.\n'.format(
cmd=pipes.quote(command)), file=sys.stderr)
cmd=shlex.quote(command)), file=sys.stderr)
help_text = helptext.HelpText(result, trace=component_trace,
verbose=component_trace.verbose)
output.append(help_text)
Expand Down
6 changes: 3 additions & 3 deletions fire/trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from __future__ import division
from __future__ import print_function

import pipes
import shlex

from fire import inspectutils

Expand Down Expand Up @@ -166,8 +166,8 @@ def display(arg1, arg2='!'):
def _Quote(self, arg):
if arg.startswith('--') and '=' in arg:
prefix, value = arg.split('=', 1)
return pipes.quote(prefix) + '=' + pipes.quote(value)
return pipes.quote(arg)
return shlex.quote(prefix) + '=' + shlex.quote(value)
return shlex.quote(arg)

def GetCommand(self, include_separators=True):
"""Returns the command representing the trace up to this point.
Expand Down