Skip to content

Commit

Permalink
No need to do non-ASCII character conversion for gmt configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
seisman committed Mar 13, 2024
1 parent 4fa3d83 commit f6b69a2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pygmt/helpers/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,15 +435,17 @@ def build_arg_string(kwdict, confdict=None, infile=None, outfile=None):
_value = str(kwdict[key]).replace(" ", "")
gmt_args.append(rf"-{key}{_value}")
gmt_args = sorted(gmt_args)
argstr = non_ascii_to_octal(" ".join(gmt_args))

if confdict:
gmt_args.extend(f'--{key}="{value}"' for key, value in confdict.items())
confstr = " ".join(f'--{key}="{value}"' for key, value in confdict.items())
argstr += f" {confstr}"

if infile:
gmt_args = [str(infile), *gmt_args]
argstr = f"{infile} {argstr}"
if outfile:
gmt_args.append("->" + str(outfile))
return non_ascii_to_octal(" ".join(gmt_args))
argstr += f" ->{outfile}"
return argstr


def is_nonstr_iter(value):
Expand Down

0 comments on commit f6b69a2

Please sign in to comment.