1
0
mirror of https://github.com/gryf/wicd.git synced 2025-12-28 17:32:36 +01:00

attempting to migrate to python 3.x

This commit is contained in:
Guido Serra
2019-08-14 16:18:46 +02:00
parent 681beb13b1
commit 2a52b83583
27 changed files with 740 additions and 165 deletions

View File

@@ -153,7 +153,7 @@ class WiredProfileChooser:
response = dialog.run()
if response == 1:
print('reading profile ', wired_profiles.get_active_text())
print(('reading profile ', wired_profiles.get_active_text()))
wired.ReadWiredNetworkProfile(wired_profiles.get_active_text())
wired.ConnectWired()
else:
@@ -821,7 +821,7 @@ class appGui(object):
# Make sure no entries are left blank
if entry.chkbox_encryption.get_active():
encryption_info = entry.encryption_info
for entry_info in encryption_info.values():
for entry_info in list(encryption_info.values()):
if entry_info[0].entry.get_text() == "" and \
entry_info[1] == 'required':
error(

View File

@@ -31,7 +31,7 @@ except ImportError:
print("Importing pynotify failed, notifications disabled.")
HAS_NOTIFY = False
print("Has notifications support", HAS_NOTIFY)
print(("Has notifications support", HAS_NOTIFY))
if wpath.no_use_notifications:
print('Notifications disabled during setup.py configure')

View File

@@ -472,7 +472,7 @@ class WiredSettingsDialog(AdvancedSettingsDialog):
encrypt_methods[self.combo_encryption.get_active()]['type']
)
# Make sure all required fields are filled in.
for entry_info in encrypt_info.values():
for entry_info in list(encrypt_info.values()):
if entry_info[0].entry.get_text() == "" and \
entry_info[1] == 'required':
error(
@@ -484,7 +484,7 @@ class WiredSettingsDialog(AdvancedSettingsDialog):
)
return False
# Now save all the entries.
for entry_key, entry_info in encrypt_info.items():
for entry_key, entry_info in list(encrypt_info.items()):
self.set_net_prop(entry_key,
noneToString(entry_info[0].entry.get_text()))
else:
@@ -689,7 +689,7 @@ class WirelessSettingsDialog(AdvancedSettingsDialog):
encrypt_methods[self.combo_encryption.get_active()]['type']
)
# Make sure all required fields are filled in.
for entry_info in encrypt_info.values():
for entry_info in list(encrypt_info.values()):
if entry_info[0].entry.get_text() == "" and \
entry_info[1] == 'required':
error(
@@ -701,7 +701,7 @@ class WirelessSettingsDialog(AdvancedSettingsDialog):
)
return False
# Now save all the entries.
for entry_key, entry_info in encrypt_info.items():
for entry_key, entry_info in list(encrypt_info.items()):
self.set_net_prop(entry_key,
noneToString(entry_info[0].entry.get_text()))
elif not self.chkbox_encryption.get_active() and \
@@ -1010,7 +1010,7 @@ class WirelessNetworkEntry(NetworkEntry):
self.lbl_encryption = GreyLabel()
self.lbl_channel = GreyLabel()
print("ESSID : " + self.essid)
print(("ESSID : " + self.essid))
self.chkbox_autoconnect = gtk.CheckButton(
_('Automatically connect to this network'))
self.chkbox_neverconnect = gtk.CheckButton(

View File

@@ -80,8 +80,8 @@ if not hasattr(gtk, "StatusIcon"):
import egg.trayicon
USE_EGG = True
except ImportError:
print('Unable to load tray icon: Missing both egg.trayicon and ' + \
'gtk.StatusIcon modules.')
print(('Unable to load tray icon: Missing both egg.trayicon and ' + \
'gtk.StatusIcon modules.'))
ICON_AVAIL = False
misc.RenameProcess("wicd-client")
@@ -114,7 +114,7 @@ def catchdbus(func):
#raise
raise DBusException(e)
else:
print("warning: ignoring exception %s" % e)
print(("warning: ignoring exception %s" % e))
return None
wrapper.__name__ = func.__name__
wrapper.__module__ = func.__module__
@@ -162,7 +162,7 @@ class TrayIcon(object):
self.tr.toggle_wicd_gui()
self.icon_info = self.TrayConnectionInfo(self, self.tr, animate)
self.tr.icon_info = self.icon_info
print('displaytray %s' % displaytray)
print(('displaytray %s' % displaytray))
self.tr.visible(displaytray)
def is_embedded(self):
@@ -270,7 +270,7 @@ class TrayIcon(object):
msg = e.args[-1]
else:
msg = str(e)
print("Exception during notification: %s" % msg)
print(("Exception during notification: %s" % msg))
self.should_notify = False
@@ -1046,7 +1046,7 @@ TX:'''))
def usage():
""" Print usage information. """
print("""
print(("""
wicd %s
wireless (and wired) connection daemon front-end.
@@ -1056,7 +1056,7 @@ Arguments:
\t-h\t--help\t\tPrint this help information.
\t-a\t--no-animate\tRun the tray without network traffic tray animations.
\t-o\t--only-notifications\tDon't display anything except notifications.
""" % wpath.version)
""" % wpath.version))
def setup_dbus(force=True):
@@ -1067,8 +1067,8 @@ def setup_dbus(force=True):
dbusmanager.connect_to_dbus()
except DBusException:
if force:
print("Can't connect to the daemon, trying to start it " + \
"automatically...")
print(("Can't connect to the daemon, trying to start it " + \
"automatically..."))
misc.PromptToStartDaemon()
try:
dbusmanager.connect_to_dbus()