diff --git a/web/pgadmin/__init__.py b/web/pgadmin/__init__.py index ef6461ee4..dd5fc0535 100644 --- a/web/pgadmin/__init__.py +++ b/web/pgadmin/__init__.py @@ -503,13 +503,13 @@ def create_app(app_name=None): svr_discovery_id = inst_id svr_comment = gettext( "Auto-detected %s installation with the data " - "directory at %s") % ( + "directory at {}".format( winreg.QueryValueEx( inst_key, 'Display Name' )[0], winreg.QueryValueEx( inst_key, 'Data Directory' - )[0]) + )[0])) add_server( user_id, servergroup_id, svr_name, @@ -557,11 +557,12 @@ def create_app(app_name=None): if hasattr(str, 'decode'): description = description.decode('utf-8') data_directory = data_directory.decode('utf-8') - svr_comment = gettext(u"Auto-detected %s installation " - u"with the data directory at %s") % ( + svr_comment = gettext(u"Auto-detected {0} installation " + u"with the data directory at {1}". + format( description, data_directory - ) + )) add_server(user_id, servergroup_id, svr_name, svr_superuser, svr_port, svr_discovery_id, svr_comment) diff --git a/web/pgadmin/browser/server_groups/servers/__init__.py b/web/pgadmin/browser/server_groups/servers/__init__.py index d62d69138..59efae8b1 100644 --- a/web/pgadmin/browser/server_groups/servers/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/__init__.py @@ -737,7 +737,8 @@ class ServerNode(PGChildNodeView): status=410, success=0, errormsg=gettext( - "Could not find the required parameter (%s).") % arg + "Could not find the required parameter ({}).". + format(arg)) ) if 'hostaddr' in data and data['hostaddr'] and data['hostaddr'] != '': @@ -835,7 +836,8 @@ class ServerNode(PGChildNodeView): status=401, success=0, errormsg=gettext( - u"Unable to connect to server:\n\n%s") % errmsg + u"Unable to connect to server:\n\n{}". + format(errmsg)) ) else: if 'save_password' in data and data['save_password'] and \ @@ -1027,7 +1029,7 @@ class ServerNode(PGChildNodeView): tunnel_password = server.tunnel_password else: tunnel_password = data['tunnel_password'] \ - if 'tunnel_password'in data else '' + if 'tunnel_password' in data else '' save_tunnel_password = data['save_tunnel_password'] \ if tunnel_password and 'save_tunnel_password' in data \ else False diff --git a/web/pgadmin/browser/server_groups/servers/databases/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/__init__.py index 085ee35b6..db6e1273a 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/__init__.py @@ -567,7 +567,8 @@ class DatabaseView(PGChildNodeView): status=410, success=0, errormsg=_( - "Could not find the required parameter (%s).") % arg + "Could not find the required parameter ({}).". + format(arg)) ) # The below SQL will execute CREATE DDL only SQL = render_template( diff --git a/web/pgadmin/browser/server_groups/servers/databases/casts/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/casts/__init__.py index 503192cb2..5558d97f8 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/casts/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/casts/__init__.py @@ -368,7 +368,8 @@ class CastView(PGChildNodeView): status=410, success=0, errormsg=gettext( - "Could not find the required parameter (%s).") % arg + "Could not find the required parameter ({}).". + format(arg)) ) try: sql = render_template("/".join([self.template_path, 'create.sql']), diff --git a/web/pgadmin/browser/server_groups/servers/databases/event_triggers/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/event_triggers/__init__.py index 42da4cfc4..45f11e655 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/event_triggers/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/event_triggers/__init__.py @@ -378,7 +378,7 @@ class EventTriggerView(PGChildNodeView): status=400, success=0, errormsg=gettext( - "Could not find the required parameter %s.") % err + "Could not find the required parameter {}.".format(err)) ) try: sql = render_template( @@ -636,7 +636,8 @@ class EventTriggerView(PGChildNodeView): status=410, success=0, errormsg=gettext( - "Could not find the required parameter %s.") % err + "Could not find the required parameter {}.". + format(err)) ) sql = render_template( "/".join([self.template_path, 'create.sql']), diff --git a/web/pgadmin/browser/server_groups/servers/databases/extensions/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/extensions/__init__.py index 9605b9b4a..f19b3452e 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/extensions/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/extensions/__init__.py @@ -262,7 +262,8 @@ class ExtensionView(PGChildNodeView): status=410, success=0, errormsg=gettext( - "Could not find the required parameter (%s).") % arg + "Could not find the required parameter ({}).". + format(arg)) ) status, res = self.conn.execute_dict( diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/__init__.py index e5bf06357..bb8d5482f 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/__init__.py @@ -393,7 +393,8 @@ class ForeignDataWrapperView(PGChildNodeView): status=410, success=0, errormsg=gettext( - "Could not find the required parameter (%s).") % arg + "Could not find the required parameter ({}).". + format(arg)) ) try: diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/__init__.py index 66fcf424b..acf07617a 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/__init__.py @@ -388,7 +388,8 @@ class ForeignServerView(PGChildNodeView): status=410, success=0, errormsg=gettext( - "Could not find the required parameter (%s).") % arg + "Could not find the required parameter ({}).". + format(arg)) ) try: if 'fsrvacl' in data: diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mappings/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mappings/__init__.py index 47e55570a..1ee66eade 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mappings/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mappings/__init__.py @@ -396,7 +396,8 @@ class UserMappingView(PGChildNodeView): status=410, success=0, errormsg=gettext( - "Could not find the required parameter (%s).") % arg + "Could not find the required parameter ({}).". + format(arg)) ) try: diff --git a/web/pgadmin/browser/server_groups/servers/databases/languages/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/languages/__init__.py index 77f22e6fa..d5ed9e297 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/languages/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/languages/__init__.py @@ -453,7 +453,8 @@ class LanguageView(PGChildNodeView): status=410, success=0, errormsg=gettext( - "Could not find the required parameter (%s).") % arg + "Could not find the required parameter ({}).". + format(arg)) ) try: diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/__init__.py index 38cdec02c..67835b431 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/__init__.py @@ -570,8 +570,8 @@ It may have been removed by another user. status=410, success=0, errormsg=gettext( - "Could not find the required parameter (%s).") % - required_args[arg] + "Could not find the required parameter ({}).". + format(required_args[arg])) ) try: self.format_request_acls(data) diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/__init__.py index 8cf703987..89f7ae547 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/__init__.py @@ -458,7 +458,8 @@ class CollationView(PGChildNodeView, SchemaDiffObjectCompare): status=410, success=0, errormsg=gettext( - "Could not find the required parameter (%s).") % arg + "Could not find the required parameter ({}).". + format(arg)) ) if self._check_definition(data): return make_json_response( diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/__init__.py index 362f7c6ce..169d8da3f 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/__init__.py @@ -422,7 +422,8 @@ class FtsConfigurationView(PGChildNodeView, SchemaDiffObjectCompare): status=410, success=0, errormsg=_( - "Could not find the required parameter (%s).") % arg + "Could not find the required parameter ({}).". + format(arg)) ) # Either copy config or parser must be present in data diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_parsers/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_parsers/__init__.py index b79b6ef5b..0f0b1f6bb 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_parsers/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_parsers/__init__.py @@ -379,7 +379,8 @@ class FtsParserView(PGChildNodeView, SchemaDiffObjectCompare): status=410, success=0, errormsg=_( - "Could not find the required parameter (%s).") % arg + "Could not find the required parameter ({}).". + format(arg)) ) # Fetch schema name from schema oid sql = render_template( diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/__init__.py index 4d61e8dcb..18bf3b8d2 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/__init__.py @@ -354,7 +354,8 @@ class FtsTemplateView(PGChildNodeView, SchemaDiffObjectCompare): status=410, success=0, errormsg=gettext( - "Could not find the required parameter (%s).") % arg + "Could not find the required parameter ({}).". + format(arg)) ) # Fetch schema name from schema oid sql = render_template("/".join([self.template_path, 'schema.sql']), diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/__init__.py index 519e30e97..b2a85090f 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/__init__.py @@ -379,7 +379,8 @@ class PackageView(PGChildNodeView, SchemaDiffObjectCompare): status=400, success=0, errormsg=_( - "Could not find the required parameter (%s).") % arg + "Could not find the required parameter ({}).". + format(arg)) ) data['schema'] = self.schema diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/__init__.py index 13623b737..ca9e46e8a 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/__init__.py @@ -450,7 +450,8 @@ class SynonymView(PGChildNodeView, SchemaDiffObjectCompare): status=410, success=0, errormsg=gettext( - "Could not find the required parameter (%s).") % arg + "Could not find the required parameter ({}).". + format(arg)) ) try: diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/__init__.py index bea7b33f4..2c7ea56e5 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/__init__.py @@ -908,7 +908,8 @@ class TableView(BaseTableView, DataTypeReader, VacuumSettings, status=410, success=0, errormsg=gettext( - "Could not find the required parameter (%s).") % arg + "Could not find the required parameter ({}).". + format(arg)) ) # Parse privilege data coming from client according to database format @@ -1577,7 +1578,7 @@ class TableView(BaseTableView, DataTypeReader, VacuumSettings, return make_json_response( status=200, - info=gettext("Table rows counted: %s") % count, + info=gettext("Table rows counted: {}".format(count)), data={'total_rows': count} ) diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/__init__.py index 280958a98..c443749cc 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/__init__.py @@ -392,8 +392,8 @@ class ColumnsView(PGChildNodeView, DataTypeReader): status=410, success=0, errormsg=gettext( - "Could not find the required parameter (%s).") % - required_args[arg] + "Could not find the required parameter ({}).". + format(required_args[arg])) ) # Parse privilege data coming from client according to database format diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/compound_triggers/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/compound_triggers/__init__.py index 553d06c31..4b56d0b8c 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/compound_triggers/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/compound_triggers/__init__.py @@ -511,8 +511,8 @@ class CompoundTriggerView(PGChildNodeView, SchemaDiffObjectCompare): status=410, success=0, errormsg=gettext( - "Could not find the required parameter (%s).") % - required_args[arg] + "Could not find the required parameter ({})." + .format(required_args[arg])) ) # Adding parent into data dict, will be using it while creating sql diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/__init__.py index 2f1ba57bb..d65d3cc33 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/__init__.py @@ -476,7 +476,8 @@ class CheckConstraintView(PGChildNodeView): status=400, success=0, errormsg=_( - "Could not find the required parameter (%s).") % arg + "Could not find the required parameter ({}).". + format(arg)) ) data['schema'] = self.schema 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 ab3ee6ab5..b2a5bbbe5 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 @@ -496,14 +496,16 @@ class ExclusionConstraintView(PGChildNodeView): status=400, success=0, errormsg=_( - "Could not find required parameter (%s).") % str(arg) + "Could not find required parameter ({}).". + format(str(arg))) ) elif isinstance(data[arg], list) and len(data[arg]) < 1: return make_json_response( status=400, success=0, errormsg=_( - "Could not find required parameter (%s).") % str(arg) + "Could not find required parameter ({}).". + format(str(arg))) ) data['schema'] = self.schema diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/__init__.py index d057a3f2f..1abbc45b3 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/__init__.py @@ -514,14 +514,16 @@ class ForeignKeyConstraintView(PGChildNodeView): status=400, success=0, errormsg=_( - "Could not find required parameter (%s).") % str(arg) + "Could not find required parameter ({}).". + format(str(arg))) ) elif isinstance(data[arg], list) and len(data[arg]) < 1: return make_json_response( status=400, success=0, errormsg=_( - "Could not find required parameter (%s).") % str(arg) + "Could not find required parameter ({}).". + format(str(arg))) ) data['schema'] = self.schema diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/__init__.py index 05c5f84d1..bd2974c3d 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/__init__.py @@ -535,7 +535,7 @@ class IndexConstraintView(PGChildNodeView): success=0, errormsg=_( "Could not find at least one required " - "parameter (%s).") % str(param) + "parameter ({}).".format(str(param))) ) elif arg not in data: @@ -543,7 +543,8 @@ class IndexConstraintView(PGChildNodeView): status=400, success=0, errormsg=_( - "Could not find the required parameter (%s).") % arg + "Could not find the required parameter ({}).". + format(arg)) ) data['schema'] = self.schema diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/__init__.py index 02eb23b02..970933479 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/__init__.py @@ -946,8 +946,8 @@ class TypeView(PGChildNodeView, DataTypeReader, SchemaDiffObjectCompare): status=410, success=0, errormsg=gettext( - "Could not find the required parameter (%s).") % - required_args[arg] + "Could not find the required parameter ({}).". + format(required_args[arg])) ) # Additional checks goes here # If type is range then check if subtype is defined or not diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/__init__.py index 955af8bc1..5d8d16249 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/__init__.py @@ -493,7 +493,8 @@ class ViewNode(PGChildNodeView, VacuumSettings, SchemaDiffObjectCompare): status=410, success=0, errormsg=gettext( - "Could not find the required parameter (%s).") % arg + "Could not find the required parameter ({}).". + format(arg)) ) try: SQL, nameOrError = self.getSQL(gid, sid, did, data) @@ -743,7 +744,7 @@ class ViewNode(PGChildNodeView, VacuumSettings, SchemaDiffObjectCompare): ).split('FROM') if 'definition' in data and ( len(old_def) > 1 or len(new_def) > 1 - ) and( + ) and ( old_def[0] != new_def[0] and old_def[0] not in new_def[0] ): diff --git a/web/pgadmin/browser/server_groups/servers/pgagent/__init__.py b/web/pgadmin/browser/server_groups/servers/pgagent/__init__.py index 28a8e5901..cb852f84c 100644 --- a/web/pgadmin/browser/server_groups/servers/pgagent/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/pgagent/__init__.py @@ -284,7 +284,8 @@ SELECT EXISTS( status=410, success=0, errormsg=_( - "Could not find the required parameter (%s).") % arg + "Could not find the required parameter ({}).". + format(arg)) ) status, res = self.conn.execute_void('BEGIN') diff --git a/web/pgadmin/browser/server_groups/servers/resource_groups/__init__.py b/web/pgadmin/browser/server_groups/servers/resource_groups/__init__.py index 24d3206ad..c68a09b9a 100644 --- a/web/pgadmin/browser/server_groups/servers/resource_groups/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/resource_groups/__init__.py @@ -363,7 +363,8 @@ class ResourceGroupView(NodeView): status=410, success=0, errormsg=gettext( - "Could not find the required parameter (%s).") % arg + "Could not find the required parameter ({}).". + format(arg)) ) try: # Below logic will create new resource group diff --git a/web/pgadmin/browser/server_groups/servers/tablespaces/__init__.py b/web/pgadmin/browser/server_groups/servers/tablespaces/__init__.py index 73e81e1b1..04954b80b 100644 --- a/web/pgadmin/browser/server_groups/servers/tablespaces/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/tablespaces/__init__.py @@ -295,8 +295,8 @@ class TablespaceView(PGChildNodeView): status=410, success=0, errormsg=gettext( - "Could not find the required parameter (%s).") % - required_args[arg] + "Could not find the required parameter ({}).". + format(required_args[arg])) ) # To format privileges coming from client