| @@ -542,7 +542,7 @@ class PluginRefreshW(QDialog, ui_carla_refresh.Ui_PluginRefreshW): | |||||
| @pyqtSlot(int, str) | @pyqtSlot(int, str) | ||||
| def slot_handlePluginLook(self, percent, plugin): | def slot_handlePluginLook(self, percent, plugin): | ||||
| self.progressBar.setFormat("%s" % (plugin)) | |||||
| self.progressBar.setFormat("%s" % plugin) | |||||
| self.progressBar.setValue(percent) | self.progressBar.setValue(percent) | ||||
| @pyqtSlot() | @pyqtSlot() | ||||
| @@ -804,7 +804,7 @@ class PluginDatabaseW(QDialog, ui_carla_database.Ui_PluginDatabaseW): | |||||
| if lastLoadedPlugin: | if lastLoadedPlugin: | ||||
| lastLoadedPlugin = os.path.basename(lastLoadedPlugin) | lastLoadedPlugin = os.path.basename(lastLoadedPlugin) | ||||
| ask = QMessageBox.question(self, self.tr("Warning"), self.tr("There was an error while checking the plugin %s.\n" | ask = QMessageBox.question(self, self.tr("Warning"), self.tr("There was an error while checking the plugin %s.\n" | ||||
| "Do you want to blacklist it?" % (lastLoadedPlugin)), | |||||
| "Do you want to blacklist it?" % lastLoadedPlugin), | |||||
| QMessageBox.Yes | QMessageBox.No, QMessageBox.Yes) | QMessageBox.Yes | QMessageBox.No, QMessageBox.Yes) | ||||
| if ask == QMessageBox.Yes: | if ask == QMessageBox.Yes: | ||||
| @@ -1254,7 +1254,7 @@ class CarlaMainW(QMainWindow, ui_carla.Ui_CarlaMainW): | |||||
| cString(Carla.Host.get_last_error()), QMessageBox.Ok, QMessageBox.Ok) | cString(Carla.Host.get_last_error()), QMessageBox.Ok, QMessageBox.Ok) | ||||
| for i in range(MAX_PLUGINS): | for i in range(MAX_PLUGINS): | ||||
| if (self.m_plugin_list[i] != None): | |||||
| if self.m_plugin_list[i] != None: | |||||
| self.act_plugin_remove_all.setEnabled(True) | self.act_plugin_remove_all.setEnabled(True) | ||||
| break | break | ||||
| else: | else: | ||||
| @@ -1264,7 +1264,7 @@ class CarlaMainW(QMainWindow, ui_carla.Ui_CarlaMainW): | |||||
| build = plugin['build'] | build = plugin['build'] | ||||
| ptype = plugin['type'] | ptype = plugin['type'] | ||||
| if (ptype == PLUGIN_LADSPA): | |||||
| if ptype == PLUGIN_LADSPA: | |||||
| unique_id = plugin['unique_id'] | unique_id = plugin['unique_id'] | ||||
| for rdf_item in self.ladspa_rdf_list: | for rdf_item in self.ladspa_rdf_list: | ||||
| if rdf_item.UniqueID == unique_id: | if rdf_item.UniqueID == unique_id: | ||||
| @@ -1272,7 +1272,7 @@ class CarlaMainW(QMainWindow, ui_carla.Ui_CarlaMainW): | |||||
| else: | else: | ||||
| return c_nullptr | return c_nullptr | ||||
| elif (ptype == PLUGIN_DSSI): | |||||
| elif ptype == PLUGIN_DSSI: | |||||
| if plugin['hints'] & PLUGIN_HAS_GUI: | if plugin['hints'] & PLUGIN_HAS_GUI: | ||||
| gui = findDSSIGUI(plugin['binary'], plugin['name'], plugin['label']) | gui = findDSSIGUI(plugin['binary'], plugin['name'], plugin['label']) | ||||
| if gui: | if gui: | ||||
| @@ -1048,8 +1048,7 @@ class ClaudiaMainW(QMainWindow, ui_claudia.Ui_ClaudiaMainW): | |||||
| self.treeWidget.expandAll() | self.treeWidget.expandAll() | ||||
| def init_ports(self): | def init_ports(self): | ||||
| #FIXME | |||||
| if (not jack.client or not DBus.patchbay): | |||||
| if not (jack.client and DBus.patchbay): | |||||
| return | return | ||||
| version, groups, conns = DBus.patchbay.GetGraph(0) | version, groups, conns = DBus.patchbay.GetGraph(0) | ||||
| @@ -1108,7 +1107,7 @@ class ClaudiaMainW(QMainWindow, ui_claudia.Ui_ClaudiaMainW): | |||||
| graph_version, project_properties = room_project_properties | graph_version, project_properties = room_project_properties | ||||
| if len(project_properties) > 0: | if len(project_properties) > 0: | ||||
| item_string = " (%s)" % (project_properties['name']) | |||||
| item_string = " (%s)" % project_properties['name'] | |||||
| else: | else: | ||||
| item_string = "" | item_string = "" | ||||
| @@ -666,7 +666,7 @@ class JackSettingsW(QDialog, ui_settings_jack.Ui_JackSettingsW): | |||||
| else: | else: | ||||
| dev_list = jackctl.GetParameterConstraint(["driver", "device"])[3] | dev_list = jackctl.GetParameterConstraint(["driver", "device"])[3] | ||||
| for i in range(len(dev_list)): | for i in range(len(dev_list)): | ||||
| self.obj_driver_device.addItem(dev_list[i][0] + " [%s]" % (str(dev_list[i][1]))) | |||||
| self.obj_driver_device.addItem(dev_list[i][0] + " [%s]" % str(dev_list[i][1])) | |||||
| # Custom 'playback' and 'capture' values | # Custom 'playback' and 'capture' values | ||||
| self.obj_driver_capture.clear() | self.obj_driver_capture.clear() | ||||
| @@ -689,8 +689,8 @@ class JackSettingsW(QDialog, ui_settings_jack.Ui_JackSettingsW): | |||||
| elif self.m_driver == "dummy": | elif self.m_driver == "dummy": | ||||
| for i in range(16): | for i in range(16): | ||||
| self.obj_driver_capture.addItem("%i" % ((i * 2) + 2)) | |||||
| self.obj_driver_playback.addItem("%i" % ((i * 2) + 2)) | |||||
| self.obj_driver_capture.addItem("%i" % int((i * 2) + 2)) | |||||
| self.obj_driver_playback.addItem("%i" % int((i * 2) + 2)) | |||||
| elif self.m_driver == "firewire": | elif self.m_driver == "firewire": | ||||
| self.obj_driver_capture.addItem("no") | self.obj_driver_capture.addItem("no") | ||||
| @@ -604,7 +604,7 @@ def joinGroup(group_id): | |||||
| break | break | ||||
| # FIXME | # FIXME | ||||
| if not item or not s_item: | |||||
| if not (item and s_item): | |||||
| qCritical("PatchCanvas::joinGroup(%i) - unable to find groups to join" % group_id) | qCritical("PatchCanvas::joinGroup(%i) - unable to find groups to join" % group_id) | ||||
| return | return | ||||
| @@ -732,7 +732,7 @@ def addPort(group_id, port_id, port_name, port_mode, port_type): | |||||
| port_widget = box_widget.addPortFromGroup(port_id, port_mode, port_type, port_name) | port_widget = box_widget.addPortFromGroup(port_id, port_mode, port_type, port_name) | ||||
| break | break | ||||
| if not box_widget or not port_widget: | |||||
| if not (box_widget and port_widget): | |||||
| qCritical("PatchCanvas::addPort(%i, %i, %s, %s, %s) - Unable to find parent group" % (group_id, port_id, port_name.encode(), port_mode2str(port_mode), port_type2str(port_type))) | qCritical("PatchCanvas::addPort(%i, %i, %s, %s, %s) - Unable to find parent group" % (group_id, port_id, port_name.encode(), port_mode2str(port_mode), port_type2str(port_type))) | ||||
| return | return | ||||
| @@ -803,7 +803,7 @@ def connectPorts(connection_id, port_out_id, port_in_id): | |||||
| port_in_parent = port_in.parentItem() | port_in_parent = port_in.parentItem() | ||||
| # FIXME | # FIXME | ||||
| if not port_out or not port_in: | |||||
| if not (port_out and port_in): | |||||
| qCritical("PatchCanvas::connectPorts(%i, %i, %i) - unable to find ports to connect" % (connection_id, port_out_id, port_in_id)) | qCritical("PatchCanvas::connectPorts(%i, %i, %i) - unable to find ports to connect" % (connection_id, port_out_id, port_in_id)) | ||||
| return | return | ||||
| @@ -1807,8 +1807,7 @@ class CanvasPort(QGraphicsItem): | |||||
| if not features.port_rename: | if not features.port_rename: | ||||
| act_x_rename.setVisible(False) | act_x_rename.setVisible(False) | ||||
| # FIXME | |||||
| if features.port_info == False and features.port_rename == False: | |||||
| if not (features.port_info and features.port_rename): | |||||
| act_x_sep_1.setVisible(False) | act_x_sep_1.setVisible(False) | ||||
| act_selected = menu.exec_(event.screenPos()) | act_selected = menu.exec_(event.screenPos()) | ||||
| @@ -2087,7 +2086,7 @@ class CanvasBox(QGraphicsItem): | |||||
| def checkItemPos(self): | def checkItemPos(self): | ||||
| if not canvas.size_rect.isNull(): | if not canvas.size_rect.isNull(): | ||||
| pos = self.scenePos() | pos = self.scenePos() | ||||
| if canvas.size_rect.contains(pos) == False or canvas.size_rect.contains(pos + QPointF(self.p_width, self.p_height)) == False: # FIXME | |||||
| if not (canvas.size_rect.contains(pos) and canvas.size_rect.contains(pos + QPointF(self.p_width, self.p_height))): | |||||
| if pos.x() < canvas.size_rect.x(): | if pos.x() < canvas.size_rect.x(): | ||||
| self.setPos(canvas.size_rect.x(), pos.y()) | self.setPos(canvas.size_rect.x(), pos.y()) | ||||
| elif pos.x() + self.p_width > canvas.size_rect.width(): | elif pos.x() + self.p_width > canvas.size_rect.width(): | ||||
| @@ -2346,8 +2345,7 @@ class CanvasBox(QGraphicsItem): | |||||
| if not features.group_rename: | if not features.group_rename: | ||||
| act_x_rename.setVisible(False) | act_x_rename.setVisible(False) | ||||
| # FIXME | |||||
| if features.group_info == False and features.group_rename == False: | |||||
| if not (features.group_info and features.group_rename): | |||||
| act_x_sep1.setVisible(False) | act_x_sep1.setVisible(False) | ||||
| haveIns = haveOuts = False | haveIns = haveOuts = False | ||||
| @@ -2358,8 +2356,7 @@ class CanvasBox(QGraphicsItem): | |||||
| elif port.port_mode == PORT_MODE_OUTPUT: | elif port.port_mode == PORT_MODE_OUTPUT: | ||||
| haveOuts = True | haveOuts = True | ||||
| # FIXME | |||||
| if self.m_splitted == False and bool(haveIns and haveOuts) == False: | |||||
| if not (self.m_splitted and bool(haveIns and haveOuts)): | |||||
| act_x_sep2.setVisible(False) | act_x_sep2.setVisible(False) | ||||
| act_x_split_join.setVisible(False) | act_x_split_join.setVisible(False) | ||||
| @@ -386,9 +386,9 @@ class PixmapKeyboard(QWidget): | |||||
| for i in range(self.m_octaves): | for i in range(self.m_octaves): | ||||
| if self.m_pixmap_mode == self.HORIZONTAL: | if self.m_pixmap_mode == self.HORIZONTAL: | ||||
| painter.drawText(i * 144, 48, 18, 18, Qt.AlignCenter, "C%i" % (i + 2)) | |||||
| painter.drawText(i * 144, 48, 18, 18, Qt.AlignCenter, "C%i" % int(i + 2)) | |||||
| elif self.m_pixmap_mode == self.VERTICAL: | elif self.m_pixmap_mode == self.VERTICAL: | ||||
| painter.drawText(45, (self.m_octaves * 144) - (i * 144) - 16, 18, 18, Qt.AlignCenter, "C%i" % (i + 2)) | |||||
| painter.drawText(45, (self.m_octaves * 144) - (i * 144) - 16, 18, 18, Qt.AlignCenter, "C%i" % int(i + 2)) | |||||
| @pyqtSlot() | @pyqtSlot() | ||||
| def slot_updateOnce(self): | def slot_updateOnce(self): | ||||
| @@ -1892,11 +1892,11 @@ class PluginWidget(QFrame, ui_carla_plugin.Ui_PluginWidget): | |||||
| current = self.sender().value() / 10 | current = self.sender().value() / 10 | ||||
| menu = QMenu(self) | menu = QMenu(self) | ||||
| actReset = menu.addAction(self.tr("Reset (%i%%)" % (default))) | |||||
| actReset = menu.addAction(self.tr("Reset (%i%%)" % default)) | |||||
| menu.addSeparator() | menu.addSeparator() | ||||
| actMinimum = menu.addAction(self.tr("Set to Minimum (%i%%)" % (minimum))) | |||||
| actMinimum = menu.addAction(self.tr("Set to Minimum (%i%%)" % minimum)) | |||||
| actCenter = menu.addAction(self.tr("Set to Center")) | actCenter = menu.addAction(self.tr("Set to Center")) | ||||
| actMaximum = menu.addAction(self.tr("Set to Maximum (%i%%)" % (maximum))) | |||||
| actMaximum = menu.addAction(self.tr("Set to Maximum (%i%%)" % maximum)) | |||||
| menu.addSeparator() | menu.addSeparator() | ||||
| actSet = menu.addAction(self.tr("Set value...")) | actSet = menu.addAction(self.tr("Set value...")) | ||||