1
0
Fork 0
This commit is contained in:
Amjith Ramanujam 2021-05-06 21:20:12 -07:00
parent 1d2570f462
commit 6309dd4f93
4 changed files with 10 additions and 12 deletions

View File

@ -1,6 +1,6 @@
repos:
- repo: https://github.com/psf/black
rev: stable
rev: 21.5b0
hooks:
- id: black
language_version: python3.7

View File

@ -1248,7 +1248,8 @@ def cli(
else:
print("Config file is now located at", config_full_path)
print(
"Please move the existing config file ~/.pgclirc to", config_full_path,
"Please move the existing config file ~/.pgclirc to",
config_full_path,
)
if list_dsn:
try:

View File

@ -140,7 +140,7 @@ class PGCompleter(Completer):
return "'{}'".format(self.unescape_name(name))
def unescape_name(self, name):
""" Unquote a string."""
"""Unquote a string."""
if name and name[0] == '"' and name[-1] == '"':
name = name[1:-1]
@ -491,14 +491,11 @@ class PGCompleter(Completer):
def get_column_matches(self, suggestion, word_before_cursor):
tables = suggestion.table_refs
do_qualify = (
suggestion.qualifiable
and {
"always": True,
"never": False,
"if_more_than_one_table": len(tables) > 1,
}[self.qualify_columns]
)
do_qualify = suggestion.qualifiable and {
"always": True,
"never": False,
"if_more_than_one_table": len(tables) > 1,
}[self.qualify_columns]
qualify = lambda col, tbl: (
(tbl + "." + self.case(col)) if do_qualify else self.case(col)
)

View File

@ -73,7 +73,7 @@ def drop_tables(conn):
def run(
executor, sql, join=False, expanded=False, pgspecial=None, exception_formatter=None
):
" Return string output for the sql to be run "
"Return string output for the sql to be run"
results = executor.run(sql, pgspecial, exception_formatter)
formatted = []