From a192255d7e1cc70eeae0c07ef2ef3bb8e5f176dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Mat=C4=9Bjek?= Date: Tue, 29 Oct 2019 02:56:28 +0100 Subject: black formating --- pgcli/main.py | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/pgcli/main.py b/pgcli/main.py index d5f6bd89..2b852b04 100644 --- a/pgcli/main.py +++ b/pgcli/main.py @@ -672,7 +672,7 @@ class PGCli(object): if self.pgspecial.timing_enabled: # Only add humanized time display if > 1 second if query.total_time > 1: - print ( + print( "Time: %0.03fs (%s), executed in: %0.03fs (%s)" % ( query.total_time, @@ -682,7 +682,7 @@ class PGCli(object): ) ) else: - print ("Time: %0.03fs" % query.total_time) + print("Time: %0.03fs" % query.total_time) # Check if we need to update completions, in order of most # to least drastic changes @@ -711,10 +711,10 @@ class PGCli(object): self.prompt_app = self._build_cli(history) if not self.less_chatty: - print ("Server: PostgreSQL", self.pgexecute.server_version) - print ("Version:", __version__) - print ("Chat: https://gitter.im/dbcli/pgcli") - print ("Home: http://pgcli.com") + print("Server: PostgreSQL", self.pgexecute.server_version) + print("Version:", __version__) + print("Chat: https://gitter.im/dbcli/pgcli") + print("Home: http://pgcli.com") try: while True: @@ -758,7 +758,7 @@ class PGCli(object): except (PgCliQuitError, EOFError): if not self.less_chatty: - print ("Goodbye!") + print("Goodbye!") def _build_cli(self, history): key_bindings = pgcli_bindings(self) @@ -1200,7 +1200,7 @@ def cli( warn, ): if version: - print ("Version:", __version__) + print("Version:", __version__) sys.exit(0) config_dir = os.path.dirname(config_location()) @@ -1212,12 +1212,11 @@ def cli( if os.path.exists(os.path.expanduser("~/.pgclirc")): if not os.path.exists(config_full_path): shutil.move(os.path.expanduser("~/.pgclirc"), config_full_path) - print ("Config file (~/.pgclirc) moved to new location", config_full_path) + print("Config file (~/.pgclirc) moved to new location", config_full_path) else: - print ("Config file is now located at", config_full_path) - print ( - "Please move the existing config file ~/.pgclirc to", - config_full_path, + print("Config file is now located at", config_full_path) + print( + "Please move the existing config file ~/.pgclirc to", config_full_path, ) if list_dsn: try: -- cgit v1.2.3 From 01520ac7286e7904108b3db845e190e106ae6060 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Mat=C4=9Bjek?= Date: Tue, 29 Oct 2019 02:57:00 +0100 Subject: Fix logging-format-interpolation --- pgcli/main.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pgcli/main.py b/pgcli/main.py index 2b852b04..0d9fcce5 100644 --- a/pgcli/main.py +++ b/pgcli/main.py @@ -132,14 +132,13 @@ class PGCli(object): if configured_pager: self.logger.info( - 'Default pager found in config file: "{}"'.format(configured_pager) + 'Default pager found in config file: "%s"', configured_pager ) os.environ["PAGER"] = configured_pager elif os_environ_pager: self.logger.info( - 'Default pager found in PAGER environment variable: "{}"'.format( - os_environ_pager - ) + 'Default pager found in PAGER environment variable: "%s"', + os_environ_pager, ) os.environ["PAGER"] = os_environ_pager else: -- cgit v1.2.3 From 23eb840ad77c6d878f1f06494c920f0c465fe801 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Mat=C4=9Bjek?= Date: Tue, 29 Oct 2019 02:59:56 +0100 Subject: Update AUTHORS --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 33d77fa2..14b745bc 100644 --- a/AUTHORS +++ b/AUTHORS @@ -100,6 +100,7 @@ Contributors: * Pablo A. Bianchi (pabloab) * Sebastian Janko (sebojanko) * Pedro Ferrari (petobens) + * Martin Matejek (mmtj) Creator: -------- -- cgit v1.2.3 From 6b2e8df8bd73f0815722bc8c967740b2d3ca3e74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Mat=C4=9Bjek?= Date: Tue, 29 Oct 2019 17:47:18 +0100 Subject: run black again --- pgcli/magic.py | 2 +- release.py | 8 ++++---- tests/features/db_utils.py | 4 ++-- tests/features/environment.py | 12 ++++++------ tests/features/fixture_utils.py | 2 +- tests/features/wrappager.py | 4 ++-- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/pgcli/magic.py b/pgcli/magic.py index 3e9a4021..f58f4150 100644 --- a/pgcli/magic.py +++ b/pgcli/magic.py @@ -43,7 +43,7 @@ def pgcli_line_magic(line): conn._pgcli = pgcli # For convenience, print the connection alias - print ("Connected: {}".format(conn.name)) + print("Connected: {}".format(conn.name)) try: pgcli.run_cli() diff --git a/release.py b/release.py index 9ac18d24..0444983e 100644 --- a/release.py +++ b/release.py @@ -36,11 +36,11 @@ def run_step(*args): global DRY_RUN cmd = args - print (" ".join(cmd)) + print(" ".join(cmd)) if skip_step(): - print ("--- Skipping...") + print("--- Skipping...") elif DRY_RUN: - print ("--- Pretending to run...") + print("--- Pretending to run...") else: subprocess.check_output(cmd) @@ -99,7 +99,7 @@ if __name__ == "__main__": checklist(checks) ver = version("pgcli/__init__.py") - print ("Releasing Version:", ver) + print("Releasing Version:", ver) parser = OptionParser() parser.add_option( diff --git a/tests/features/db_utils.py b/tests/features/db_utils.py index 4eba6063..7f8a2e7d 100644 --- a/tests/features/db_utils.py +++ b/tests/features/db_utils.py @@ -48,7 +48,7 @@ def create_cn(hostname, password, username, dbname, port): host=hostname, user=username, database=dbname, password=password, port=port ) - print ("Created connection: {0}.".format(cn.dsn)) + print("Created connection: {0}.".format(cn.dsn)) return cn @@ -79,4 +79,4 @@ def close_cn(cn=None): """ if cn: cn.close() - print ("Closed connection: {0}.".format(cn.dsn)) + print("Closed connection: {0}.".format(cn.dsn)) diff --git a/tests/features/environment.py b/tests/features/environment.py index 0133ab01..349e9dd6 100644 --- a/tests/features/environment.py +++ b/tests/features/environment.py @@ -29,8 +29,8 @@ def before_all(context): ) fixture_dir = os.path.join(context.package_root, "tests/features/fixture_data") - print ("package root:", context.package_root) - print ("fixture dir:", fixture_dir) + print("package root:", context.package_root) + print("fixture dir:", fixture_dir) os.environ["COVERAGE_PROCESS_START"] = os.path.join( context.package_root, ".coveragerc" @@ -123,14 +123,14 @@ def before_all(context): def show_env_changes(env_old, env_new): """Print out all test-specific env values.""" - print ("--- os.environ changed values: ---") + print("--- os.environ changed values: ---") all_keys = set(list(env_old.keys()) + list(env_new.keys())) for k in sorted(all_keys): old_value = env_old.get(k, "") new_value = env_new.get(k, "") if new_value and old_value != new_value: - print ('{}="{}"'.format(k, new_value)) - print ("-" * 20) + print('{}="{}"'.format(k, new_value)) + print("-" * 20) def after_all(context): @@ -181,7 +181,7 @@ def after_scenario(context, scenario): try: context.cli.expect_exact(pexpect.EOF, timeout=15) except pexpect.TIMEOUT: - print ("--- after_scenario {}: kill cli".format(scenario.name)) + print("--- after_scenario {}: kill cli".format(scenario.name)) context.cli.kill(signal.SIGKILL) if hasattr(context, "tmpfile_sql_help") and context.tmpfile_sql_help: context.tmpfile_sql_help.close() diff --git a/tests/features/fixture_utils.py b/tests/features/fixture_utils.py index 6cb74b2d..25204544 100644 --- a/tests/features/fixture_utils.py +++ b/tests/features/fixture_utils.py @@ -22,7 +22,7 @@ def read_fixture_files(): """Read all files inside fixture_data directory.""" current_dir = os.path.dirname(__file__) fixture_dir = os.path.join(current_dir, "fixture_data/") - print ("reading fixture data: {}".format(fixture_dir)) + print("reading fixture data: {}".format(fixture_dir)) fixture_dict = {} for filename in os.listdir(fixture_dir): if filename not in [".", ".."]: diff --git a/tests/features/wrappager.py b/tests/features/wrappager.py index e98ea979..51d49095 100755 --- a/tests/features/wrappager.py +++ b/tests/features/wrappager.py @@ -3,13 +3,13 @@ import sys def wrappager(boundary): - print (boundary) + print(boundary) while 1: buf = sys.stdin.read(2048) if not buf: break sys.stdout.write(buf) - print (boundary) + print(boundary) if __name__ == "__main__": -- cgit v1.2.3