diff --git a/zenmap/zenmapCore/NmapParser.py b/zenmap/zenmapCore/NmapParser.py index 3d1af1cbf..422a0b163 100644 --- a/zenmap/zenmapCore/NmapParser.py +++ b/zenmap/zenmapCore/NmapParser.py @@ -640,8 +640,8 @@ in epoch format!") return scan_name if self.profile_name and self.get_targets(): return _("%(profile_name)s on %(targets)s") % { - profile_name = self.profile_name, - targets = join_quoted(self.get_targets()) + 'profile_name': self.profile_name, + 'targets': join_quoted(self.get_targets()) } return self.get_nmap_command() diff --git a/zenmap/zenmapGUI/About.py b/zenmap/zenmapGUI/About.py index 12b71ebc5..23358d8d8 100644 --- a/zenmap/zenmapGUI/About.py +++ b/zenmap/zenmapGUI/About.py @@ -130,7 +130,7 @@ class About(HIGDialog): def __init__(self): HIGDialog.__init__(self) self.set_title(_("About %(nmap)s and %(zenmap)s") % { - nmap = NMAP_DISPLAY_NAME, zenmap = APP_DISPLAY_NAME }) + 'nmap': NMAP_DISPLAY_NAME, 'zenmap': APP_DISPLAY_NAME }) self.vbox.set_border_width(12) self.vbox.set_spacing(12) @@ -155,14 +155,14 @@ class About(HIGDialog): entry = _program_entry(APP_DISPLAY_NAME, APP_WEB_SITE, _( "%(zenmap)s is a multi-platform graphical %(nmap)s frontend and results viewer. " "It was originally derived from %(umit)s.") % { - zenmap = APP_DISPLAY_NAME, - nmap = NMAP_DISPLAY_NAME, - umit = UMIT_DISPLAY_NAME}) + 'zenmap': APP_DISPLAY_NAME, + 'nmap': NMAP_DISPLAY_NAME, + 'umit': UMIT_DISPLAY_NAME}) self.vbox.pack_start(entry, True, True, 0) entry = _program_entry(UMIT_DISPLAY_NAME, UMIT_WEB_SITE, _( "%(umit)s is a %(nmap)s GUI created as part of the Nmap/Google Summer " - "of Code program.") % {umit = UMIT_DISPLAY_NAME, nmap = NMAP_DISPLAY_NAME}) + "of Code program.") % {'umit': UMIT_DISPLAY_NAME, 'nmap': NMAP_DISPLAY_NAME}) button = Gtk.Button.new_with_label(_("%s credits") % UMIT_DISPLAY_NAME) button.connect("clicked", self._show_umit_credits) entry.hbox.pack_start(button, False, True, 0) diff --git a/zenmap/zenmapGUI/App.py b/zenmap/zenmapGUI/App.py index b37a65161..6e9778228 100644 --- a/zenmap/zenmapGUI/App.py +++ b/zenmap/zenmapGUI/App.py @@ -227,9 +227,9 @@ The specific error was %(zenmap)s needs to create this directory to store information such as the list of \ scan profiles. Check for access to the directory and try again.""") % { - dirname = repr(Path.user_config_dir), - configdir = repr(Path.config_dir), - error = repr(str(e)), zenmap = APP_DISPLAY_NAME + 'dirname': repr(Path.user_config_dir), + 'configdir': repr(Path.config_dir), + 'error': repr(str(e)), zenmap = APP_DISPLAY_NAME } ) error_dialog.run() @@ -253,7 +253,8 @@ The specific error was %(zenmap)s can continue without this file but any information in it will be ignored \ until it is repaired.""") % { - filename = Path.user_config_file, error = str(e), zenmap = APP_DISPLAY_NAME} + 'filename': Path.user_config_file, + 'error': str(e), 'zenmap': APP_DISPLAY_NAME} ) error_dialog.run() error_dialog.destroy() @@ -266,7 +267,8 @@ To avoid further errors parsing the configuration file %(filename)s, \ you can copy the default configuration from %(dirname)s. Do this now? \ -""") % {filename = Path.user_config_file, dirname = global_config_path}, +""") % { + 'filename': Path.user_config_file, 'dirname': global_config_path}, ) repair_dialog.add_button(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL) repair_dialog.set_default_response(Gtk.ResponseType.CANCEL) @@ -323,7 +325,7 @@ class NonRootWarning (HIGAlertDialog): warning_text = _('''You are trying to run %(zenmap)s with a non-root user! Some %(nmap)s options need root privileges to work.''') % { - zenmap = APP_DISPLAY_NAME, nmap = NMAP_DISPLAY_NAME} + 'zenmap': APP_DISPLAY_NAME, 'nmap': NMAP_DISPLAY_NAME} HIGAlertDialog.__init__(self, message_format=_('Non-root user'), secondary_text=warning_text) diff --git a/zenmap/zenmapGUI/MainWindow.py b/zenmap/zenmapGUI/MainWindow.py index 3f46b0440..7d7fd518d 100644 --- a/zenmap/zenmapGUI/MainWindow.py +++ b/zenmap/zenmapGUI/MainWindow.py @@ -899,8 +899,8 @@ This scan has not been run yet. Start the scan with the "Scan" button first.')) 'An error occurred when saving to\n%(configfile)s' '\nThe error was: %(error)s.' ) % { - configfile = Path.user_config_file, - error = config_parser.failed + 'configfile': Path.user_config_file, + 'error': config_parser.failed }) alert.run() alert.destroy() @@ -949,7 +949,7 @@ This scan has not been run yet. Start the scan with the "Scan" button first.')) There was an error loading the documentation file %(helpfile)s (%(error)s). See the \ online documentation at %(url)s.\ """) % { - helpfile = doc_path, error = str(e), url = APP_DOCUMENTATION_SITE}) + 'helpfile': doc_path, 'error': str(e), 'url': APP_DOCUMENTATION_SITE}) d.run() d.destroy() diff --git a/zenmap/zenmapGUI/ScanInterface.py b/zenmap/zenmapGUI/ScanInterface.py index 79a81e851..5a8a2e61c 100644 --- a/zenmap/zenmapGUI/ScanInterface.py +++ b/zenmap/zenmapGUI/ScanInterface.py @@ -686,8 +686,8 @@ class ScanInterface(HIGVBox): self.filter_bar.set_information_text( _("%(num_shown)d/%(total)d hosts shown") % { - num_shown = len(self.inventory.get_hosts_up()), - total = len(NetworkInventory.get_hosts_up(self.inventory)) + 'num_shown': len(self.inventory.get_hosts_up()), + 'total': len(NetworkInventory.get_hosts_up(self.inventory)) }) mode = self.scan_result.scan_host_view.mode diff --git a/zenmap/zenmapGUI/TopologyPage.py b/zenmap/zenmapGUI/TopologyPage.py index bb9d33be5..3947c83f2 100644 --- a/zenmap/zenmapGUI/TopologyPage.py +++ b/zenmap/zenmapGUI/TopologyPage.py @@ -140,7 +140,7 @@ class TopologyPage(HIGVBox): self.slow_label.set_text(_("""\ Topology is disabled because too many hosts can cause it to run slowly. The limit is %(limit)d hosts and there are %(num)d.\ -""" % {limit = SLOW_LIMIT, num = len(hosts_up)})) +""" % {'limit': SLOW_LIMIT, 'num': len(hosts_up)})) if len(hosts_up) <= SLOW_LIMIT: self.radialnet.show()