MCPcopy Index your code
hub / github.com/dbcli/pgcli / _format_arg

Method _format_arg

pgcli/pgcompleter.py:741–756  ·  view source on GitHub ↗
(self, template, arg, arg_num, max_arg_len)

Source from the content-addressed store, hash-verified

739 return "(" + ", ".join(a for a in args if a) + ")"
740
741 def _format_arg(self, template, arg, arg_num, max_arg_len):
742 if not template:
743 return None
744 if arg.has_default:
745 arg_default = "NULL" if arg.default is None else arg.default
746 # Remove trailing ::(schema.)type
747 arg_default = arg_default_type_strip_regex.sub("", arg_default)
748 else:
749 arg_default = ""
750 return template.format(
751 max_arg_len=max_arg_len,
752 arg_name=self.case(arg.name),
753 arg_num=arg_num,
754 arg_type=arg.datatype,
755 arg_default=arg_default,
756 )
757
758 def _make_cand(self, tbl, do_alias, suggestion, arg_mode=None):
759 """Returns a Candidate namedtuple.

Callers 1

_arg_listMethod · 0.95

Calls 1

caseMethod · 0.95

Tested by

no test coverage detected