From 41fe1db8844d439198b58df0b7a3d4bf1490cf34 Mon Sep 17 00:00:00 2001 From: Akshay Joshi Date: Thu, 25 Jan 2024 12:51:29 +0530 Subject: [PATCH] Fixed PEP8 --- .../tables/constraints/exclusion_constraint/__init__.py | 9 ++++++--- .../schemas/tables/row_security_policies/utils.py | 3 ++- .../servers/databases/schemas/tables/triggers/utils.py | 3 ++- web/pgadmin/tools/backup/__init__.py | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/__init__.py index 514b41f05..3ae4f2f72 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/__init__.py @@ -377,7 +377,8 @@ class ExclusionConstraintView(PGChildNodeView): _, rset = self.conn.execute_2darray(SQL) if len(rset['rows']) == 0: - return gone(gettext("""Could not find the exclusion constraint.""")) + return gone( + gettext("""Could not find the exclusion constraint.""")) res = self.blueprint.generate_browser_node( rset['rows'][0]['oid'], @@ -795,7 +796,8 @@ class ExclusionConstraintView(PGChildNodeView): if not status: return rows if len(rows) == 0: - return gone(gettext("Could not find the exclusion constraint.")) + return gone( + gettext("Could not find the exclusion constraint.")) data = rows[0] data['schema'] = self.schema @@ -854,7 +856,8 @@ class ExclusionConstraintView(PGChildNodeView): if not status: return internal_server_error(errormsg=result) if len(result['rows']) == 0: - return gone(gettext("Could not find the exclusion constraint.")) + return gone( + gettext("Could not find the exclusion constraint.")) data = result['rows'][0] name = data['name'] diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/utils.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/utils.py index 08fc128b2..82028b02f 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/utils.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/utils.py @@ -82,7 +82,8 @@ def get_sql(conn, **kwargs): return internal_server_error(errormsg=res) if len(res['rows']) == 0: - raise ObjectGone(gettext('Could not find the policy in the table.')) + raise ObjectGone( + gettext('Could not find the policy in the table.')) old_data = dict(res['rows'][0]) old_data['schema'] = schema diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/utils.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/utils.py index 797d339ed..fb41dcdd2 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/utils.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/utils.py @@ -165,7 +165,8 @@ def get_sql(conn, **kwargs): if not status: raise ExecuteError(res) elif len(res['rows']) == 0: - raise ObjectGone(gettext('Could not find the trigger in the table.')) + raise ObjectGone( + gettext('Could not find the trigger in the table.')) old_data = dict(res['rows'][0]) # If name is not present in data then diff --git a/web/pgadmin/tools/backup/__init__.py b/web/pgadmin/tools/backup/__init__.py index 7e5ac34c7..cbc379aa9 100644 --- a/web/pgadmin/tools/backup/__init__.py +++ b/web/pgadmin/tools/backup/__init__.py @@ -144,7 +144,7 @@ class BackupMessage(IProcessDesc): ).format(server_name, self.database) if self.backup_type == BACKUP.GLOBALS: return gettext("Backing up the global objects on " - "the server '{0}'").format( + "the server '{0}'").format( server_name ) elif self.backup_type == BACKUP.SERVER: