mirror of
https://github.com/fergalmoran/picard.git
synced 2026-04-28 15:21:18 +00:00
use python super instead of calling with class name
This commit is contained in:
@@ -29,7 +29,7 @@ from picard.acoustid.json_helpers import parse_recording
|
||||
class AcoustIDClient(QtCore.QObject):
|
||||
|
||||
def __init__(self):
|
||||
QtCore.QObject.__init__(self)
|
||||
super().__init__()
|
||||
self._queue = deque()
|
||||
self._running = 0
|
||||
self._max_processes = 2
|
||||
|
||||
@@ -36,7 +36,7 @@ class Submission(object):
|
||||
class AcoustIDManager(QtCore.QObject):
|
||||
|
||||
def __init__(self):
|
||||
QtCore.QObject.__init__(self)
|
||||
super().__init__()
|
||||
self._fingerprints = {}
|
||||
|
||||
def add(self, file, recordingid):
|
||||
|
||||
@@ -50,7 +50,7 @@ register_album_metadata_processor(coverart)
|
||||
|
||||
class AlbumArtist(DataObject):
|
||||
def __init__(self, album_artist_id):
|
||||
DataObject.__init__(self, album_artist_id)
|
||||
super().__init__(album_artist_id)
|
||||
|
||||
|
||||
class Album(DataObject, Item):
|
||||
|
||||
@@ -26,7 +26,7 @@ class BrowserIntegration(QtNetwork.QTcpServer):
|
||||
"""Simple HTTP server for web browser integration."""
|
||||
|
||||
def __init__(self, parent=None):
|
||||
QtNetwork.QTcpServer.__init__(self, parent)
|
||||
super().__init__(parent)
|
||||
self.newConnection.connect(self._accept_connection)
|
||||
self.port = 0
|
||||
self.host_address = None
|
||||
|
||||
@@ -362,8 +362,7 @@ class CaaCoverArtImage(CoverArtImage):
|
||||
sourceprefix = "CAA"
|
||||
|
||||
def __init__(self, url, types=None, is_front=False, comment='', data=None):
|
||||
CoverArtImage.__init__(self, url=url, types=types, comment=comment,
|
||||
data=data)
|
||||
super().__init__(url=url, types=types, comment=comment, data=data)
|
||||
self.is_front = is_front
|
||||
|
||||
|
||||
@@ -373,8 +372,7 @@ class CaaThumbnailCoverArtImage(CaaCoverArtImage):
|
||||
property"""
|
||||
|
||||
def __init__(self, url, types=None, is_front=False, comment='', data=None):
|
||||
CaaCoverArtImage.__init__(self, url=url, types=types, comment=comment,
|
||||
data=data)
|
||||
super().__init__(url=url, types=types, comment=comment, data=data)
|
||||
self.is_front = False
|
||||
self.can_be_saved_to_disk = False
|
||||
self.can_be_saved_to_tags = False
|
||||
@@ -387,8 +385,7 @@ class TagCoverArtImage(CoverArtImage):
|
||||
|
||||
def __init__(self, file, tag=None, types=None, is_front=None,
|
||||
support_types=False, comment='', data=None):
|
||||
CoverArtImage.__init__(self, url=None, types=types, comment=comment,
|
||||
data=data)
|
||||
super().__init__(url=None, types=types, comment=comment, data=data)
|
||||
self.sourcefile = file
|
||||
self.tag = tag
|
||||
self.support_types = support_types
|
||||
@@ -423,8 +420,7 @@ class CoverArtImageFromFile(CoverArtImage):
|
||||
|
||||
def __init__(self, filepath, types=None, is_front=None,
|
||||
support_types=False, comment='', data=None):
|
||||
CoverArtImage.__init__(self, url=None, types=types, comment=comment,
|
||||
data=data)
|
||||
super().__init__(url=None, types=types, comment=comment, data=data)
|
||||
self.filepath = filepath
|
||||
self.support_types = support_types
|
||||
if is_front is not None:
|
||||
|
||||
@@ -232,7 +232,7 @@ class CoverArtProviderCaa(CoverArtProvider):
|
||||
coverartimage_thumbnail_class = CaaThumbnailCoverArtImage
|
||||
|
||||
def __init__(self, coverart):
|
||||
CoverArtProvider.__init__(self, coverart)
|
||||
super().__init__(coverart)
|
||||
self.caa_types = list(map(str.lower, config.setting["caa_image_types"]))
|
||||
self.len_caa_types = len(self.caa_types)
|
||||
self.restrict_types = config.setting["caa_restrict_image_types"]
|
||||
|
||||
@@ -23,7 +23,7 @@ from picard.util import LockableObject
|
||||
class DataObject(LockableObject):
|
||||
|
||||
def __init__(self, obj_id):
|
||||
LockableObject.__init__(self)
|
||||
super().__init__()
|
||||
self.id = obj_id
|
||||
self.folksonomy_tags = {}
|
||||
self.item = None
|
||||
|
||||
@@ -38,7 +38,7 @@ from picard.ui.cdlookup import CDLookupDialog
|
||||
class Disc(QtCore.QObject):
|
||||
|
||||
def __init__(self):
|
||||
QtCore.QObject.__init__(self)
|
||||
super().__init__()
|
||||
self.id = None
|
||||
self.submission_url = None
|
||||
|
||||
|
||||
@@ -242,7 +242,7 @@ class PluginManager(QtCore.QObject):
|
||||
plugin_updated = QtCore.pyqtSignal(str, bool)
|
||||
|
||||
def __init__(self):
|
||||
QtCore.QObject.__init__(self)
|
||||
super().__init__()
|
||||
self.plugins = []
|
||||
self._api_versions = set([version_from_string(v) for v in picard.api_versions])
|
||||
self._available_plugins = {}
|
||||
|
||||
@@ -31,7 +31,7 @@ from picard.util import uniqify
|
||||
class ReleaseGroup(DataObject):
|
||||
|
||||
def __init__(self, rg_id):
|
||||
DataObject.__init__(self, rg_id)
|
||||
super().__init__(rg_id)
|
||||
self.metadata = Metadata()
|
||||
self.loaded = False
|
||||
self.versions = []
|
||||
|
||||
@@ -110,7 +110,7 @@ class Tagger(QtWidgets.QApplication):
|
||||
|
||||
# Set the WM_CLASS to 'MusicBrainz-Picard' so desktop environments
|
||||
# can use it to look up the app
|
||||
QtWidgets.QApplication.__init__(self, ['MusicBrainz-Picard'] + unparsed_args)
|
||||
super().__init__(['MusicBrainz-Picard'] + unparsed_args)
|
||||
self.__class__.__instance = self
|
||||
config._setup(self, picard_args.config_file)
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ _TRANSLATE_TAGS = {
|
||||
|
||||
class TrackArtist(DataObject):
|
||||
def __init__(self, ta_id):
|
||||
DataObject.__init__(self, ta_id)
|
||||
super().__init__(ta_id)
|
||||
|
||||
|
||||
class Track(DataObject, Item):
|
||||
@@ -242,7 +242,7 @@ class Track(DataObject, Item):
|
||||
class NonAlbumTrack(Track):
|
||||
|
||||
def __init__(self, nat_id):
|
||||
Track.__init__(self, nat_id, self.tagger.nats)
|
||||
super().__init__(nat_id, self.tagger.nats)
|
||||
self.callback = None
|
||||
self.loaded = False
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ class PicardDialog(QtWidgets.QDialog):
|
||||
flags = QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint
|
||||
|
||||
def __init__(self, parent=None):
|
||||
QtWidgets.QDialog.__init__(self, parent, self.flags)
|
||||
super().__init__(parent, self.flags)
|
||||
|
||||
|
||||
# With py3, QObjects are no longer hashable unless they have
|
||||
|
||||
@@ -39,7 +39,7 @@ class CDLookupDialog(PicardDialog):
|
||||
]
|
||||
|
||||
def __init__(self, releases, disc, parent=None):
|
||||
PicardDialog.__init__(self, parent)
|
||||
super().__init__(parent)
|
||||
self.releases = releases
|
||||
self.disc = disc
|
||||
self.ui = Ui_Dialog()
|
||||
|
||||
@@ -26,7 +26,7 @@ from picard.collection import user_collections, load_user_collections
|
||||
class CollectionMenu(QtWidgets.QMenu):
|
||||
|
||||
def __init__(self, albums, *args):
|
||||
QtWidgets.QMenu.__init__(self, *args)
|
||||
super().__init__(*args)
|
||||
self.ids = set(a.id for a in albums)
|
||||
self.update_collections()
|
||||
|
||||
@@ -56,7 +56,7 @@ class CollectionCheckBox(QtWidgets.QCheckBox):
|
||||
def __init__(self, menu, collection):
|
||||
self.menu = menu
|
||||
self.collection = collection
|
||||
QtWidgets.QCheckBox.__init__(self, self.label())
|
||||
super().__init__(self.label())
|
||||
|
||||
releases = collection.releases & menu.ids
|
||||
if len(releases) == len(menu.ids):
|
||||
|
||||
@@ -37,7 +37,7 @@ class ActiveLabel(QtWidgets.QLabel):
|
||||
image_dropped = QtCore.pyqtSignal(QtCore.QUrl, QtCore.QByteArray)
|
||||
|
||||
def __init__(self, active=True, drops=False, *args):
|
||||
QtWidgets.QLabel.__init__(self, *args)
|
||||
super().__init__(*args)
|
||||
self.setMargin(0)
|
||||
self.setActive(active)
|
||||
self.setAcceptDrops(drops)
|
||||
@@ -270,7 +270,7 @@ def set_image_append(obj, coverartimage):
|
||||
class CoverArtBox(QtWidgets.QGroupBox):
|
||||
|
||||
def __init__(self, parent):
|
||||
QtWidgets.QGroupBox.__init__(self, "")
|
||||
super().__init__("")
|
||||
self.layout = QtWidgets.QVBoxLayout()
|
||||
self.layout.setSpacing(6)
|
||||
self.parent = parent
|
||||
|
||||
@@ -26,7 +26,7 @@ from picard.ui.ui_edittagdialog import Ui_EditTagDialog
|
||||
class EditTagDialog(PicardDialog):
|
||||
|
||||
def __init__(self, window, tag):
|
||||
PicardDialog.__init__(self, window)
|
||||
super().__init__(window)
|
||||
self.ui = Ui_EditTagDialog()
|
||||
self.ui.setupUi(self)
|
||||
self.window = window
|
||||
|
||||
@@ -34,7 +34,7 @@ class FileBrowser(QtWidgets.QTreeView):
|
||||
]
|
||||
|
||||
def __init__(self, parent):
|
||||
QtWidgets.QTreeView.__init__(self, parent)
|
||||
super().__init__(parent)
|
||||
self.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection)
|
||||
self.setDragEnabled(True)
|
||||
self.move_files_here_action = QtWidgets.QAction(_("&Move Tagged Files Here"), self)
|
||||
|
||||
@@ -34,7 +34,7 @@ from picard.ui.ui_infodialog import Ui_InfoDialog
|
||||
|
||||
class ArtworkTable(QtWidgets.QTableWidget):
|
||||
def __init__(self, display_existing_art):
|
||||
QtWidgets.QTableWidget.__init__(self, 0, 2)
|
||||
super().__init__(0, 2)
|
||||
self.display_existing_art = display_existing_art
|
||||
h_header = self.horizontalHeader()
|
||||
v_header = self.verticalHeader()
|
||||
@@ -98,7 +98,7 @@ class ArtworkTable(QtWidgets.QTableWidget):
|
||||
class InfoDialog(PicardDialog):
|
||||
|
||||
def __init__(self, obj, parent=None):
|
||||
PicardDialog.__init__(self, parent)
|
||||
super().__init__(parent)
|
||||
self.obj = obj
|
||||
self.images = []
|
||||
self.existing_images = []
|
||||
|
||||
@@ -37,7 +37,7 @@ class BaseAction(QtWidgets.QAction):
|
||||
MENU = []
|
||||
|
||||
def __init__(self):
|
||||
QtWidgets.QAction.__init__(self, self.NAME, None)
|
||||
super().__init__(self.NAME, None)
|
||||
self.triggered.connect(self.__callback)
|
||||
|
||||
def __callback(self):
|
||||
@@ -97,7 +97,7 @@ class MainPanel(QtWidgets.QSplitter):
|
||||
]
|
||||
|
||||
def __init__(self, window, parent=None):
|
||||
QtWidgets.QSplitter.__init__(self, parent)
|
||||
super().__init__(parent)
|
||||
self.window = window
|
||||
self.create_icons()
|
||||
self.views = [FileTreeView(window, self), AlbumTreeView(window, self)]
|
||||
@@ -221,7 +221,7 @@ class BaseTreeView(QtWidgets.QTreeWidget):
|
||||
]
|
||||
|
||||
def __init__(self, window, parent=None):
|
||||
QtWidgets.QTreeWidget.__init__(self, parent)
|
||||
super().__init__(parent)
|
||||
self.window = window
|
||||
self.panel = parent
|
||||
|
||||
@@ -551,7 +551,7 @@ class FileTreeView(BaseTreeView):
|
||||
view_sizes = config.TextOption("persist", "file_view_sizes", "250 40 100")
|
||||
|
||||
def __init__(self, window, parent=None):
|
||||
BaseTreeView.__init__(self, window, parent)
|
||||
super().__init__(window, parent)
|
||||
self.setAccessibleName(_("file view"))
|
||||
self.setAccessibleDescription(_("Contains unmatched files and clusters"))
|
||||
self.unmatched_files = ClusterItem(self.tagger.unclustered_files, False, self)
|
||||
@@ -581,7 +581,7 @@ class AlbumTreeView(BaseTreeView):
|
||||
view_sizes = config.TextOption("persist", "album_view_sizes", "250 40 100")
|
||||
|
||||
def __init__(self, window, parent=None):
|
||||
BaseTreeView.__init__(self, window, parent)
|
||||
super().__init__(window, parent)
|
||||
self.setAccessibleName(_("album view"))
|
||||
self.setAccessibleDescription(_("Contains albums and matched files"))
|
||||
self.tagger.album_added.connect(self.add_album)
|
||||
@@ -607,7 +607,7 @@ class TreeItem(QtWidgets.QTreeWidgetItem):
|
||||
__lt__ = lambda self, other: False
|
||||
|
||||
def __init__(self, obj, sortable, *args):
|
||||
QtWidgets.QTreeWidgetItem.__init__(self, *args)
|
||||
super().__init__(*args)
|
||||
self.obj = obj
|
||||
if obj is not None:
|
||||
obj.item = self
|
||||
@@ -625,7 +625,7 @@ class TreeItem(QtWidgets.QTreeWidgetItem):
|
||||
class ClusterItem(TreeItem):
|
||||
|
||||
def __init__(self, *args):
|
||||
TreeItem.__init__(self, *args)
|
||||
super().__init__(*args)
|
||||
self.setIcon(0, ClusterItem.icon_dir)
|
||||
|
||||
def update(self):
|
||||
|
||||
@@ -75,7 +75,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
||||
]
|
||||
|
||||
def __init__(self, parent=None):
|
||||
QtWidgets.QMainWindow.__init__(self, parent)
|
||||
super().__init__(parent)
|
||||
self.selected_objects = []
|
||||
self.ignore_selection_changes = False
|
||||
self.toolbar = None
|
||||
|
||||
@@ -151,7 +151,7 @@ class MetadataBox(QtWidgets.QTableWidget):
|
||||
)
|
||||
|
||||
def __init__(self, parent):
|
||||
QtWidgets.QTableWidget.__init__(self, parent)
|
||||
super().__init__(parent)
|
||||
self.parent = parent
|
||||
self.setAccessibleName(_("metadata view"))
|
||||
self.setAccessibleDescription(_("Displays original and new tags for the selected files"))
|
||||
|
||||
@@ -73,7 +73,7 @@ class OptionsDialog(PicardDialog):
|
||||
self.default_item = items[0]
|
||||
|
||||
def __init__(self, default_page=None, parent=None):
|
||||
PicardDialog.__init__(self, parent)
|
||||
super().__init__(parent)
|
||||
|
||||
from picard.ui.ui_options import Ui_Dialog
|
||||
self.ui = Ui_Dialog()
|
||||
|
||||
@@ -33,7 +33,7 @@ DEFAULT_SCRIPT_NAME = N_("My script")
|
||||
class TaggerScriptSyntaxHighlighter(QtGui.QSyntaxHighlighter):
|
||||
|
||||
def __init__(self, document):
|
||||
QtGui.QSyntaxHighlighter.__init__(self, document)
|
||||
super().__init__(document)
|
||||
self.func_re = QtCore.QRegExp(r"\$(?!noop)[a-zA-Z][_a-zA-Z0-9]*\(")
|
||||
self.func_fmt = QtGui.QTextCharFormat()
|
||||
self.func_fmt.setFontWeight(QtGui.QFont.Bold)
|
||||
|
||||
@@ -26,7 +26,7 @@ from picard.ui.ui_passworddialog import Ui_PasswordDialog
|
||||
class PasswordDialog(PicardDialog):
|
||||
|
||||
def __init__(self, authenticator, reply, parent=None):
|
||||
PicardDialog.__init__(self, parent)
|
||||
super().__init__(parent)
|
||||
self._authenticator = authenticator
|
||||
self.ui = Ui_PasswordDialog()
|
||||
self.ui.setupUi(self)
|
||||
@@ -46,7 +46,7 @@ class PasswordDialog(PicardDialog):
|
||||
class ProxyDialog(PicardDialog):
|
||||
|
||||
def __init__(self, authenticator, proxy, parent=None):
|
||||
PicardDialog.__init__(self, parent)
|
||||
super().__init__(parent)
|
||||
self._authenticator = authenticator
|
||||
self._proxy = proxy
|
||||
self.ui = Ui_PasswordDialog()
|
||||
|
||||
@@ -24,7 +24,7 @@ from picard import config
|
||||
class RatingWidget(QtWidgets.QWidget):
|
||||
|
||||
def __init__(self, parent, track):
|
||||
QtWidgets.QWidget.__init__(self, parent)
|
||||
super().__init__(parent)
|
||||
self._track = track
|
||||
self._maximum = config.setting["rating_steps"] - 1
|
||||
self._rating = int(track.metadata["~rating"] or 0)
|
||||
|
||||
@@ -36,7 +36,7 @@ class TagsFromFileNamesDialog(PicardDialog):
|
||||
]
|
||||
|
||||
def __init__(self, files, parent=None):
|
||||
PicardDialog.__init__(self, parent)
|
||||
super().__init__(parent)
|
||||
self.ui = Ui_TagsFromFileNamesDialog()
|
||||
self.ui.setupUi(self)
|
||||
items = [
|
||||
|
||||
@@ -43,7 +43,7 @@ class StandardButton(QtWidgets.QPushButton):
|
||||
if hasattr(QtWidgets.QStyle, iconname):
|
||||
icon = self.tagger.style().standardIcon(getattr(QtWidgets.QStyle, iconname))
|
||||
args = [icon, label]
|
||||
QtWidgets.QPushButton.__init__(self, *args)
|
||||
super().__init__(*args)
|
||||
|
||||
|
||||
# The following code is there to fix
|
||||
@@ -68,7 +68,7 @@ def find_starting_directory():
|
||||
class ButtonLineEdit(QtWidgets.QLineEdit):
|
||||
|
||||
def __init__(self, parent=None):
|
||||
QtWidgets.QLineEdit.__init__(self, parent)
|
||||
super().__init__(parent)
|
||||
|
||||
self.clear_button = QtWidgets.QToolButton(self)
|
||||
self.clear_button.setVisible(False)
|
||||
|
||||
@@ -45,7 +45,7 @@ class LockableObject(QtCore.QObject):
|
||||
"""Read/write lockable object."""
|
||||
|
||||
def __init__(self):
|
||||
QtCore.QObject.__init__(self)
|
||||
super().__init__()
|
||||
self.__lock = QtCore.QReadWriteLock()
|
||||
|
||||
def lock_for_read(self):
|
||||
|
||||
@@ -25,7 +25,7 @@ from PyQt5.QtCore import QRunnable, QCoreApplication, QEvent
|
||||
class ProxyToMainEvent(QEvent):
|
||||
|
||||
def __init__(self, func, *args, **kwargs):
|
||||
QEvent.__init__(self, QEvent.User)
|
||||
super().__init__(QEvent.User)
|
||||
self.func = func
|
||||
self.args = args
|
||||
self.kwargs = kwargs
|
||||
@@ -37,7 +37,7 @@ class ProxyToMainEvent(QEvent):
|
||||
class Runnable(QRunnable):
|
||||
|
||||
def __init__(self, func, next_func, traceback=True):
|
||||
QRunnable.__init__(self)
|
||||
super().__init__()
|
||||
self.func = func
|
||||
self.next_func = next_func
|
||||
self.traceback = traceback
|
||||
|
||||
Reference in New Issue
Block a user