mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fixed code smells 'Define a constant instead of duplicating this literal' reported by SonarQube.
This commit is contained in:
@@ -98,6 +98,7 @@ class BackupMessage(IProcessDesc):
|
||||
self.bfile = _bfile
|
||||
self.database = _kwargs['database'] if 'database' in _kwargs else None
|
||||
self.cmd = ''
|
||||
self.args_str = "{0} ({1}:{2})"
|
||||
|
||||
def cmd_arg(x):
|
||||
if x:
|
||||
@@ -151,22 +152,19 @@ class BackupMessage(IProcessDesc):
|
||||
return _(
|
||||
"Backing up an object on the server '{0}' "
|
||||
"from database '{1}'"
|
||||
).format(
|
||||
"{0} ({1}:{2})".format(
|
||||
name, host, port
|
||||
),
|
||||
html.safe_str(self.database)
|
||||
)
|
||||
).format(self.args_str.format(name, host, port),
|
||||
html.safe_str(self.database)
|
||||
)
|
||||
if self.backup_type == BACKUP.GLOBALS:
|
||||
return _("Backing up the global objects on "
|
||||
"the server '{0}'").format(
|
||||
"{0} ({1}:{2})".format(
|
||||
self.args_str.format(
|
||||
name, host, port
|
||||
)
|
||||
)
|
||||
elif self.backup_type == BACKUP.SERVER:
|
||||
return _("Backing up the server '{0}'").format(
|
||||
"{0} ({1}:{2})".format(
|
||||
self.args_str.format(
|
||||
name, host, port
|
||||
)
|
||||
)
|
||||
@@ -184,7 +182,7 @@ class BackupMessage(IProcessDesc):
|
||||
"Backing up an object on the server '{0}' "
|
||||
"from database '{1}'..."
|
||||
).format(
|
||||
"{0} ({1}:{2})".format(
|
||||
self.args_str.format(
|
||||
name, host, port
|
||||
),
|
||||
self.database
|
||||
@@ -193,14 +191,14 @@ class BackupMessage(IProcessDesc):
|
||||
elif self.backup_type == BACKUP.GLOBALS:
|
||||
msg = _("Backing up the global objects on "
|
||||
"the server '{0}'...").format(
|
||||
"{0} ({1}:{2})".format(
|
||||
self.args_str.format(
|
||||
name, host, port
|
||||
)
|
||||
)
|
||||
res += html.safe_str(msg)
|
||||
elif self.backup_type == BACKUP.SERVER:
|
||||
msg = _("Backing up the server '{0}'...").format(
|
||||
"{0} ({1}:{2})".format(
|
||||
self.args_str.format(
|
||||
name, host, port
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user