From b0830f7b2b322ed4e795b779fb8b5cd3b015634a Mon Sep 17 00:00:00 2001 From: Sean Robinson Date: Sat, 12 Apr 2014 04:11:46 -0700 Subject: [PATCH] Use Python's auto-concatenation of strings within parenthesis This pattern works better when combining gettext and string.format. Signed-off-by: Sean Robinson --- wifi-radar | 14 +++++++------- wifiradar/config.py | 4 ++-- wifiradar/connections.py | 16 ++++++++-------- wifiradar/gui/g2/__init__.py | 2 +- wifiradar/gui/g2/transients.py | 4 ++-- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/wifi-radar b/wifi-radar index 794149f..fab521a 100755 --- a/wifi-radar +++ b/wifi-radar @@ -128,17 +128,17 @@ else: try: config.read() except (NameError, SyntaxError) as e: - error_message = ('A configuration file from a pre-2.0 version ' + - 'of WiFi Radar was found at {FILE}.\n\nWiFi Radar v2.0.x does ' + + error_message = ('A configuration file from a pre-2.0 version ' + 'of WiFi Radar was found at {FILE}.\n\nWiFi Radar v2.0.x does ' 'not read configuration files from previous versions. ') if isinstance(e, NameError): - error_message += ('Because {FILE} may contain information ' + - 'that you might wish to use when configuring WiFi Radar ' + + error_message += ('Because {FILE} may contain information ' + 'that you might wish to use when configuring WiFi Radar ' '{VERSION}, rename this file and run the program again.') elif isinstance(e, SyntaxError): - error_message += ('The old configuration file is probably ' + - 'empty and can be removed. Rename {FILE} if you want ' + - 'to be very careful. After removing or renaming ' + + error_message += ('The old configuration file is probably ' + 'empty and can be removed. Rename {FILE} if you want ' + 'to be very careful. After removing or renaming ' '{FILE}, run this program again.') error_message = error_message.format(FILE=CONF_FILE, VERSION=misc.WIFI_RADAR_VERSION) diff --git a/wifiradar/config.py b/wifiradar/config.py index 7843f1c..a6f637a 100644 --- a/wifiradar/config.py +++ b/wifiradar/config.py @@ -108,10 +108,10 @@ class ConfigManager(object, configparser.SafeConfigParser): # return the first device in the list return wireless_devices[0] except OSError as e: - logger.critical('problem auto-detecting wireless ' + \ + logger.critical('problem auto-detecting wireless ' 'device using iwconfig: {EXC}'.format(EXC=e)) except IndexError: - logger.critical('No WiFi device found, ' + \ + logger.critical('No WiFi device found, ' 'please set this in the preferences.') raise misc.NoDeviceError('No WiFi device found.') else: diff --git a/wifiradar/connections.py b/wifiradar/connections.py index a820f43..7f3862a 100644 --- a/wifiradar/connections.py +++ b/wifiradar/connections.py @@ -103,8 +103,8 @@ def scanner(config_manager, msg_pipe): try: device = config_manager.get_network_device() except misc.NoDeviceError as e: - logger.critical('Wifi device not found, ' + - 'please set this in the preferences.') + logger.critical('Wifi device not found, ' + 'please set this in the preferences.') scan = False running = False @@ -117,7 +117,7 @@ def scanner(config_manager, msg_pipe): scandata = Popen(iwlist_command, stdout=PIPE, stderr=STDOUT).stdout except OSError as e: - logger.critical('iwlist command not found, ' + + logger.critical('iwlist command not found, ' 'please set this in the preferences.') running = False scan = False @@ -329,7 +329,7 @@ class ConnectionManager(object): dhcp_proc = Popen(dhcp_command, stdout=None, stderr=None) except OSError as e: if e.errno == 2: - logger.critical('DHCP client not found, ' + + logger.critical('DHCP client not found, ' 'please set this in the preferences.') else: # The DHCP client daemon should timeout on its own, hence @@ -543,7 +543,7 @@ class ConnectionManager(object): stderr=STDOUT).stdout except OSError as e: if e.errno == 2: - logger.critical("ifconfig command not found, " + + logger.critical("ifconfig command not found, " "please set this in the preferences.") raise e else: @@ -587,7 +587,7 @@ class ConnectionManager(object): return ip_re.search(line).group(1) except OSError as e: if e.errno == 2: - logger.critical("ifconfig command not found, " + + logger.critical("ifconfig command not found, " "please set this in the preferences.") return None @@ -608,7 +608,7 @@ class ConnectionManager(object): return essid_re.search(line).group(2) except OSError as e: if e.errno == 2: - logger.critical("iwconfig command not found, " + + logger.critical("iwconfig command not found, " "please set this in the preferences.") return None @@ -629,7 +629,7 @@ class ConnectionManager(object): return bssid_re.search(line).group(2) except OSError as e: if e.errno == 2: - logger.critical("iwconfig command not found, " + + logger.critical("iwconfig command not found, " "please set this in the preferences.") return None diff --git a/wifiradar/gui/g2/__init__.py b/wifiradar/gui/g2/__init__.py index 83fd8f3..1bbb4ad 100644 --- a/wifiradar/gui/g2/__init__.py +++ b/wifiradar/gui/g2/__init__.py @@ -591,7 +591,7 @@ class RadarWindow(gtk.Dialog, object): dlg = gtk.MessageDialog(self, gtk.DIALOG_DESTROY_WITH_PARENT | gtk.DIALOG_MODAL, gtk.MESSAGE_QUESTION, gtk.BUTTONS_YES_NO, - 'This network does not have a profile configured.\n\n' + + 'This network does not have a profile configured.\n\n' 'Would you like to create one now?') res = dlg.run() dlg.destroy() diff --git a/wifiradar/gui/g2/transients.py b/wifiradar/gui/g2/transients.py index a437448..9aa79bb 100644 --- a/wifiradar/gui/g2/transients.py +++ b/wifiradar/gui/g2/transients.py @@ -56,8 +56,8 @@ class AboutDialog(gtk.AboutDialog, object): "Richard Monk", "Kevin Otte", "Nathanael Rebsch", "Andrea Scarpino", "Prokhor Shuchalov", "Patrick Winnertz"]) self.set_comments("WiFi connection manager") - self.set_copyright("Copyright 2004-2014 by various authors " + \ - "and contributors\nCurrent Maintainer: " + \ + self.set_copyright("Copyright 2004-2014 by various authors " + "and contributors\nCurrent Maintainer: " "Sean Robinson ") self.set_documenters(["Gary Case"]) license = """ -- 2.11.4.GIT