update to py3

2to3 -w .
This commit is contained in:
Nedko Arnaudov 2021-02-14 21:39:47 +02:00
parent 498fc36fc6
commit 8ea30191d6
8 changed files with 11 additions and 11 deletions

View File

@ -25,7 +25,7 @@ import sys
if sys.version_info.major == 3:
from configparser import SafeConfigParser, MissingSectionHeaderError
elif sys.version_info.major == 2:
from ConfigParser import SafeConfigParser, MissingSectionHeaderError
from configparser import SafeConfigParser, MissingSectionHeaderError
else:
raise Exception("Unsupported Python's interpreter version.")

View File

@ -36,7 +36,7 @@ class LadiController(object):
try:
self.is_started ()
return True
except Exception, err:
except Exception as err:
sys.stderr.write(str(err) + '\n')
sys.stderr.flush()
return False

View File

@ -106,7 +106,7 @@ class LadiManagerGtk(LadiManager):
def on_about(self, *args, **kwargs):
logo_pixbuf = GdkPixbuf.Pixbuf.new_from_file(find_data_file("laditools_logo.svg"))
copyright_str = u"""Copyright \xa9 2011-2012 Alessio Treglia <quadrispro@ubuntu.com>
copyright_str = """Copyright \xa9 2011-2012 Alessio Treglia <quadrispro@ubuntu.com>
Copyright \xa9 2007-2010 Marc-Olivier Barre <marco@marcochapeau.org>
Copyright \xa9 2007-2010 Nedko Arnaudov <nedko@arnaudov.name>"""
ad = Gtk.AboutDialog.new()

View File

@ -49,7 +49,7 @@ class LadiMenu(LadiManagerGtk):
def on_menu_command(self, widget, function):
try:
function()
except Exception, e:
except Exception as e:
error = Gtk.MessageDialog(None,
Gtk.DialogFlags.MODAL,
Gtk.MessageType.ERROR,
@ -92,7 +92,7 @@ class LadiMenu(LadiManagerGtk):
item.show()
menu.append(item)
item.connect("button-release-event", function, module)
except Exception, err:
except Exception as err:
sys.stderr.write(str(err))
sys.stderr.flush()
if not menu.get_children():
@ -110,7 +110,7 @@ class LadiMenu(LadiManagerGtk):
item.show()
menu.append(item)
item.connect("button-release-event", function, studio) # "activate" is not used because of focus bug in pygtk
except Exception, e:
except Exception as e:
self.menu_clear(menu)
item = Gtk.MenuItem(_("Error obtaining studio list"))
item.set_sensitive(False)

View File

@ -149,7 +149,7 @@ class JackConfigProxy(LadiController):
iface_name=conf_iface_name)
def name_owner_changed (name = None, old_owner = None, new_owner = None):
print "Name changed : %r" % name
print("Name changed : %r" % name)
def get_selected_driver (self):
isset, default, value = self.controller_iface.GetParameterValue (['engine', 'driver'])

View File

@ -74,7 +74,7 @@ class LadishProxy(LadiController):
try:
self.studio_is_loaded()
return True
except Exception, e:
except Exception as e:
return False
def studio_list(self):

View File

@ -228,7 +228,7 @@ class LadiManager(LadiController):
if 'command' in kwargs:
commandline = kwargs['command']
command = commandline[0]
if command not in self.proc_list.keys():
if command not in list(self.proc_list.keys()):
self.proc_list[command] = subprocess.Popen(commandline)
return True
return False
@ -251,7 +251,7 @@ class LadiManager(LadiController):
raise NotImplementedError("This is a virtual method")
else:
# Take a look at the processes we've started so we don't get any zombies
for i in self.proc_list.keys():
for i in list(self.proc_list.keys()):
if self.proc_list[i].poll () != None:
self.proc_list.pop(i)
return True

View File

@ -66,7 +66,7 @@ class my_build_extra(build_extra.build_extra):
filename = os.path.split(manpage)[-1]
subdir = 'man%s' % filename[-1]
path = os.path.join('share', 'man', subdir)
print manpage
print(manpage)
data_files.append((path, (manpage,)))
build_extra.build_extra.run(self)