Skip to content

Commit

Permalink
#444: Removed pipes dependency (#447)
Browse files Browse the repository at this point in the history
Co-authored-by: Svayp11 <[email protected]>
  • Loading branch information
BasedDepartment1 and Svayp11 committed Mar 11, 2024
1 parent c417aec commit 027c502
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
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 @@ -240,7 +239,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 @@ -296,7 +295,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

0 comments on commit 027c502

Please sign in to comment.