diff --git a/picard/cluster.py b/picard/cluster.py index 37f0172f4..94e86480d 100644 --- a/picard/cluster.py +++ b/picard/cluster.py @@ -292,7 +292,7 @@ class UnclusteredFiles(Cluster): """Special cluster for 'Unmatched Files' which have no PUID and have not been clustered.""" def __init__(self): - super(UnclusteredFiles, self).__init__(_("Unclustered Files"), special=True) + super().__init__(_("Unclustered Files"), special=True) def add_files(self, files): Cluster.add_files(self, files) @@ -327,7 +327,7 @@ class ClusterList(list, Item): """A list of clusters.""" def __init__(self): - super(ClusterList, self).__init__() + super().__init__() def __hash__(self): return id(self) diff --git a/picard/coverart/providers/__init__.py b/picard/coverart/providers/__init__.py index 370b80bf7..e0c1097dd 100644 --- a/picard/coverart/providers/__init__.py +++ b/picard/coverart/providers/__init__.py @@ -54,7 +54,7 @@ class ProviderOptions(OptionsPage): PARENT = "cover" def __init__(self, parent=None): - super(ProviderOptions, self).__init__(parent) + super().__init__(parent) self.ui = self._options_ui() self.ui.setupUi(self) diff --git a/picard/coverart/providers/amazon.py b/picard/coverart/providers/amazon.py index 147b0cacc..19acd7a72 100644 --- a/picard/coverart/providers/amazon.py +++ b/picard/coverart/providers/amazon.py @@ -91,7 +91,7 @@ class CoverArtProviderAmazon(CoverArtProvider): TITLE = N_('Amazon') def enabled(self): - return (super(CoverArtProviderAmazon, self).enabled() + return (super().enabled() and not self.coverart.front_image_found) def queue_images(self): diff --git a/picard/coverart/providers/caa.py b/picard/coverart/providers/caa.py index b2f6af7b1..e1b41c43b 100644 --- a/picard/coverart/providers/caa.py +++ b/picard/coverart/providers/caa.py @@ -45,7 +45,7 @@ class CAATypesSelectorDialog(QtWidgets.QDialog): def __init__(self, parent=None, types=None): if types is None: types = [] - super(CAATypesSelectorDialog, self).__init__(parent) + super().__init__(parent) self.setWindowTitle(_("Cover art types")) self._items = {} @@ -143,7 +143,7 @@ class ProviderOptionsCaa(ProviderOptions): _options_ui = Ui_CaaOptions def __init__(self, parent=None): - super(ProviderOptionsCaa, self).__init__(parent) + super().__init__(parent) self.ui.restrict_images_types.clicked.connect(self.update_caa_types) self.ui.select_caa_types.clicked.connect(self.select_caa_types) @@ -251,7 +251,7 @@ class CoverArtProviderCaa(CoverArtProvider): def enabled(self): """Check if CAA artwork has to be downloaded""" - if not super(CoverArtProviderCaa, self).enabled() or \ + if not super().enabled() or \ self.coverart.front_image_found: return False if self.restrict_types and not self.len_caa_types: diff --git a/picard/coverart/providers/local.py b/picard/coverart/providers/local.py index 0ca1ce743..7c8f71627 100644 --- a/picard/coverart/providers/local.py +++ b/picard/coverart/providers/local.py @@ -41,7 +41,7 @@ class ProviderOptionsLocal(ProviderOptions): _options_ui = Ui_LocalOptions def __init__(self, parent=None): - super(ProviderOptionsLocal, self).__init__(parent) + super().__init__(parent) self.init_regex_checker(self.ui.local_cover_regex_edit, self.ui.local_cover_regex_error) self.ui.local_cover_regex_default.clicked.connect(self.set_local_cover_regex_default) diff --git a/picard/coverart/providers/whitelist.py b/picard/coverart/providers/whitelist.py index cfcf66722..4a0f8e9c3 100644 --- a/picard/coverart/providers/whitelist.py +++ b/picard/coverart/providers/whitelist.py @@ -37,7 +37,7 @@ class CoverArtProviderWhitelist(CoverArtProvider): TITLE = N_('Whitelist') def enabled(self): - return (super(CoverArtProviderWhitelist, self).enabled() + return (super().enabled() and not self.coverart.front_image_found) def queue_images(self): diff --git a/picard/file.py b/picard/file.py index b30e36ad0..e70cf6446 100644 --- a/picard/file.py +++ b/picard/file.py @@ -76,7 +76,7 @@ class File(QtCore.QObject, Item): } def __init__(self, filename): - super(File, self).__init__() + super().__init__() self.filename = filename self.base_filename = os.path.basename(filename) self._state = File.UNDEFINED diff --git a/picard/formats/apev2.py b/picard/formats/apev2.py index 9a5bfd879..b6ad6022a 100644 --- a/picard/formats/apev2.py +++ b/picard/formats/apev2.py @@ -216,7 +216,7 @@ class MusepackFile(APEv2File): _File = mutagen.musepack.Musepack def _info(self, metadata, file): - super(MusepackFile, self)._info(metadata, file) + super()._info(metadata, file) metadata['~format'] = "Musepack, SV%d" % file.info.version @@ -228,7 +228,7 @@ class WavPackFile(APEv2File): _File = mutagen.wavpack.WavPack def _info(self, metadata, file): - super(WavPackFile, self)._info(metadata, file) + super()._info(metadata, file) metadata['~format'] = self.NAME def _save_and_rename(self, old_filename, metadata): @@ -248,7 +248,7 @@ class OptimFROGFile(APEv2File): _File = mutagen.optimfrog.OptimFROG def _info(self, metadata, file): - super(OptimFROGFile, self)._info(metadata, file) + super()._info(metadata, file) if file.filename.lower().endswith(".ofs"): metadata['~format'] = "OptimFROG DualStream Audio" else: @@ -263,7 +263,7 @@ class MonkeysAudioFile(APEv2File): _File = mutagen.monkeysaudio.MonkeysAudio def _info(self, metadata, file): - super(MonkeysAudioFile, self)._info(metadata, file) + super()._info(metadata, file) metadata['~format'] = self.NAME @@ -275,5 +275,5 @@ class TAKFile(APEv2File): _File = tak.TAK def _info(self, metadata, file): - super(TAKFile, self)._info(metadata, file) + super()._info(metadata, file) metadata['~format'] = self.NAME diff --git a/picard/formats/id3.py b/picard/formats/id3.py index 590a41fda..657ed6a04 100644 --- a/picard/formats/id3.py +++ b/picard/formats/id3.py @@ -573,7 +573,7 @@ class MP3File(ID3File): return mutagen.mp3.MP3(filename, ID3=compatid3.CompatID3) def _info(self, metadata, file): - super(MP3File, self)._info(metadata, file) + super()._info(metadata, file) id3version = '' if file.tags is not None and file.info.layer == 3: id3version = ' - ID3v%d.%d' % (file.tags.version[0], file.tags.version[1]) @@ -591,7 +591,7 @@ class TrueAudioFile(ID3File): return mutagen.trueaudio.TrueAudio(filename, ID3=compatid3.CompatID3) def _info(self, metadata, file): - super(TrueAudioFile, self)._info(metadata, file) + super()._info(metadata, file) metadata['~format'] = self.NAME @@ -622,7 +622,7 @@ if mutagen.aiff: tags.save(filename, v2_version=4) def _info(self, metadata, file): - super(AiffFile, self)._info(metadata, file) + super()._info(metadata, file) metadata['~format'] = self.NAME else: AiffFile = None diff --git a/picard/formats/mp4.py b/picard/formats/mp4.py index 2a889fcf4..6588472f9 100644 --- a/picard/formats/mp4.py +++ b/picard/formats/mp4.py @@ -254,6 +254,6 @@ class MP4File(File): return None def _info(self, metadata, file): - super(MP4File, self)._info(metadata, file) + super()._info(metadata, file) if hasattr(file.info, 'codec_description') and file.info.codec_description: metadata['~format'] = "%s (%s)" % (metadata['~format'], file.info.codec_description) diff --git a/picard/formats/mutagenext/compatid3.py b/picard/formats/mutagenext/compatid3.py index 379702fc4..eedb23b72 100644 --- a/picard/formats/mutagenext/compatid3.py +++ b/picard/formats/mutagenext/compatid3.py @@ -61,7 +61,7 @@ class CompatID3(ID3): known_frames["XDOR"] = XDOR known_frames["XSOP"] = XSOP kwargs["known_frames"] = known_frames - super(CompatID3, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) def update_to_v23(self): # leave TSOP, TSOA and TSOT even though they are officially defined @@ -69,6 +69,6 @@ class CompatID3(ID3): frames = [] for key in ["TSOP", "TSOA", "TSOT", "TSST"]: frames.extend(self.getall(key)) - super(CompatID3, self).update_to_v23() + super().update_to_v23() for frame in frames: self.add(frame) diff --git a/picard/formats/vorbis.py b/picard/formats/vorbis.py index 1976bc9ff..0a5a82ee3 100644 --- a/picard/formats/vorbis.py +++ b/picard/formats/vorbis.py @@ -272,7 +272,7 @@ class FLACFile(VCommentFile): _File = mutagen.flac.FLAC def _info(self, metadata, file): - super(FLACFile, self)._info(metadata, file) + super()._info(metadata, file) metadata['~format'] = self.NAME @@ -284,7 +284,7 @@ class OggFLACFile(VCommentFile): _File = mutagen.oggflac.OggFLAC def _info(self, metadata, file): - super(OggFLACFile, self)._info(metadata, file) + super()._info(metadata, file) metadata['~format'] = self.NAME @@ -296,7 +296,7 @@ class OggSpeexFile(VCommentFile): _File = mutagen.oggspeex.OggSpeex def _info(self, metadata, file): - super(OggSpeexFile, self)._info(metadata, file) + super()._info(metadata, file) metadata['~format'] = self.NAME @@ -308,7 +308,7 @@ class OggTheoraFile(VCommentFile): _File = mutagen.oggtheora.OggTheora def _info(self, metadata, file): - super(OggTheoraFile, self)._info(metadata, file) + super()._info(metadata, file) metadata['~format'] = self.NAME @@ -320,7 +320,7 @@ class OggVorbisFile(VCommentFile): _File = mutagen.oggvorbis.OggVorbis def _info(self, metadata, file): - super(OggVorbisFile, self)._info(metadata, file) + super()._info(metadata, file) metadata['~format'] = self.NAME @@ -332,7 +332,7 @@ class OggOpusFile(VCommentFile): _File = OggOpus def _info(self, metadata, file): - super(OggOpusFile, self)._info(metadata, file) + super()._info(metadata, file) metadata['~format'] = self.NAME diff --git a/picard/metadata.py b/picard/metadata.py index cfb4cb8ec..0e3213449 100644 --- a/picard/metadata.py +++ b/picard/metadata.py @@ -58,7 +58,7 @@ class Metadata(dict): multi_valued_joiner = MULTI_VALUED_JOINER def __init__(self): - super(Metadata, self).__init__() + super().__init__() self.images = ImageList() self.deleted_tags = set() self.length = 0 diff --git a/picard/plugin.py b/picard/plugin.py index 4bf462bfe..493400ea3 100644 --- a/picard/plugin.py +++ b/picard/plugin.py @@ -130,7 +130,7 @@ class ExtensionPoint(object): class PluginShared(object): def __init__(self): - super(PluginShared, self).__init__() + super().__init__() self.new_version = "" self.enabled = False self.can_be_updated = False @@ -141,7 +141,7 @@ class PluginShared(object): class PluginWrapper(PluginShared): def __init__(self, module, plugindir, file=None, manifest_data=None): - super(PluginWrapper, self).__init__() + super().__init__() self.module = module self.compatible = False self.dir = plugindir @@ -221,7 +221,7 @@ class PluginData(PluginShared): """Used to store plugin data from JSON API""" def __init__(self, d, module_name): self.__dict__ = d - super(PluginData, self).__init__() + super().__init__() self.module_name = module_name def __getattribute__(self, name): diff --git a/picard/ui/coverartbox.py b/picard/ui/coverartbox.py index c299503e5..da4db1ec8 100644 --- a/picard/ui/coverartbox.py +++ b/picard/ui/coverartbox.py @@ -97,7 +97,7 @@ class ActiveLabel(QtWidgets.QLabel): class CoverArtThumbnail(ActiveLabel): def __init__(self, active=False, drops=False, pixmap_cache=None, *args, **kwargs): - super(CoverArtThumbnail, self).__init__(active, drops, *args, **kwargs) + super().__init__(active, drops, *args, **kwargs) self.data = None self.has_common_images = None self.shadow = QtGui.QPixmap(":/images/CoverArtShadow.png") @@ -329,7 +329,7 @@ class CoverArtBox(QtWidgets.QGroupBox): def show(self): self.update_display(True) - super(CoverArtBox, self).show() + super().show() def set_metadata(self, metadata, orig_metadata, item): if not metadata or not metadata.images: diff --git a/picard/ui/options/about.py b/picard/ui/options/about.py index af9e523ac..bb7ebaf69 100644 --- a/picard/ui/options/about.py +++ b/picard/ui/options/about.py @@ -33,7 +33,7 @@ class AboutOptionsPage(OptionsPage): ACTIVE = True def __init__(self, parent=None): - super(AboutOptionsPage, self).__init__(parent) + super().__init__(parent) self.ui = Ui_AboutOptionsPage() self.ui.setupUi(self) diff --git a/picard/ui/options/advanced.py b/picard/ui/options/advanced.py index fd46b4d06..d02113b3f 100644 --- a/picard/ui/options/advanced.py +++ b/picard/ui/options/advanced.py @@ -42,7 +42,7 @@ class AdvancedOptionsPage(OptionsPage): ] def __init__(self, parent=None): - super(AdvancedOptionsPage, self).__init__(parent) + super().__init__(parent) self.ui = Ui_AdvancedOptionsPage() self.ui.setupUi(self) self.init_regex_checker(self.ui.ignore_regex, self.ui.regex_error) diff --git a/picard/ui/options/cdlookup.py b/picard/ui/options/cdlookup.py index 053f244a1..4a3d23820 100644 --- a/picard/ui/options/cdlookup.py +++ b/picard/ui/options/cdlookup.py @@ -46,7 +46,7 @@ class CDLookupOptionsPage(OptionsPage): ] def __init__(self, parent=None): - super(CDLookupOptionsPage, self).__init__(parent) + super().__init__(parent) self.ui = Ui_CDLookupOptionsPage() self.ui.setupUi(self) if AUTO_DETECT_DRIVES: diff --git a/picard/ui/options/cover.py b/picard/ui/options/cover.py index 988af560a..fe1ffdea1 100644 --- a/picard/ui/options/cover.py +++ b/picard/ui/options/cover.py @@ -51,7 +51,7 @@ class CoverOptionsPage(OptionsPage): ] def __init__(self, parent=None): - super(CoverOptionsPage, self).__init__(parent) + super().__init__(parent) self.ui = Ui_CoverOptionsPage() self.ui.setupUi(self) self.ui.save_images_to_files.clicked.connect(self.update_filename) @@ -79,7 +79,7 @@ class CoverOptionsPage(OptionsPage): def restore_defaults(self): # Remove previous entries self.provider_list_widget.clear() - super(CoverOptionsPage, self).restore_defaults() + super().restore_defaults() def load(self): self.ui.save_images_to_tags.setChecked(config.setting["save_images_to_tags"]) diff --git a/picard/ui/options/fingerprinting.py b/picard/ui/options/fingerprinting.py index 6c9c20d41..e536fb2dc 100644 --- a/picard/ui/options/fingerprinting.py +++ b/picard/ui/options/fingerprinting.py @@ -42,7 +42,7 @@ class FingerprintingOptionsPage(OptionsPage): ] def __init__(self, parent=None): - super(FingerprintingOptionsPage, self).__init__(parent) + super().__init__(parent) self._fpcalc_valid = True self.ui = Ui_FingerprintingOptionsPage() self.ui.setupUi(self) diff --git a/picard/ui/options/folksonomy.py b/picard/ui/options/folksonomy.py index b5b361527..a22cbc8f0 100644 --- a/picard/ui/options/folksonomy.py +++ b/picard/ui/options/folksonomy.py @@ -40,7 +40,7 @@ class FolksonomyOptionsPage(OptionsPage): ] def __init__(self, parent=None): - super(FolksonomyOptionsPage, self).__init__(parent) + super().__init__(parent) self.ui = Ui_FolksonomyOptionsPage() self.ui.setupUi(self) diff --git a/picard/ui/options/general.py b/picard/ui/options/general.py index 40827bd43..c5667e583 100644 --- a/picard/ui/options/general.py +++ b/picard/ui/options/general.py @@ -48,7 +48,7 @@ class GeneralOptionsPage(OptionsPage): ] def __init__(self, parent=None): - super(GeneralOptionsPage, self).__init__(parent) + super().__init__(parent) self.ui = Ui_GeneralOptionsPage() self.ui.setupUi(self) self.ui.server_host.addItems(MUSICBRAINZ_SERVERS) @@ -90,7 +90,7 @@ class GeneralOptionsPage(OptionsPage): authorization_code, scopes, self.on_authorization_finished) def restore_defaults(self): - super(GeneralOptionsPage, self).restore_defaults() + super().restore_defaults() self.logout() def on_authorization_finished(self, successful): diff --git a/picard/ui/options/interface.py b/picard/ui/options/interface.py index 302980b52..0aa09ae2c 100644 --- a/picard/ui/options/interface.py +++ b/picard/ui/options/interface.py @@ -119,7 +119,7 @@ class InterfaceOptionsPage(OptionsPage): ] def __init__(self, parent=None): - super(InterfaceOptionsPage, self).__init__(parent) + super().__init__(parent) self.ui = Ui_InterfaceOptionsPage() self.ui.setupUi(self) self.ui.ui_language.addItem(_('System default'), '') @@ -189,7 +189,7 @@ class InterfaceOptionsPage(OptionsPage): self.update_layout_config() def restore_defaults(self): - super(InterfaceOptionsPage, self).restore_defaults() + super().restore_defaults() self.update_buttons() def starting_directory_browse(self): @@ -278,13 +278,13 @@ class InterfaceOptionsPage(OptionsPage): class ToolbarListItem(QtWidgets.QListWidgetItem): def __init__(self, action_name, *args, **kwargs): - super(ToolbarListItem, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) self.action_name = action_name class AddActionDialog(QtWidgets.QDialog): def __init__(self, action_list, *args, **kwargs): - super(AddActionDialog, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) layout = QtWidgets.QVBoxLayout(self) diff --git a/picard/ui/options/matching.py b/picard/ui/options/matching.py index b39630243..00ced9ffb 100644 --- a/picard/ui/options/matching.py +++ b/picard/ui/options/matching.py @@ -39,7 +39,7 @@ class MatchingOptionsPage(OptionsPage): _release_type_sliders = {} def __init__(self, parent=None): - super(MatchingOptionsPage, self).__init__(parent) + super().__init__(parent) self.ui = Ui_MatchingOptionsPage() self.ui.setupUi(self) diff --git a/picard/ui/options/metadata.py b/picard/ui/options/metadata.py index aad69b80b..26aac64eb 100644 --- a/picard/ui/options/metadata.py +++ b/picard/ui/options/metadata.py @@ -44,7 +44,7 @@ class MetadataOptionsPage(OptionsPage): ] def __init__(self, parent=None): - super(MetadataOptionsPage, self).__init__(parent) + super().__init__(parent) self.ui = Ui_MetadataOptionsPage() self.ui.setupUi(self) self.ui.va_name_default.clicked.connect(self.set_va_name_default) diff --git a/picard/ui/options/network.py b/picard/ui/options/network.py index a7467f828..6899db70a 100644 --- a/picard/ui/options/network.py +++ b/picard/ui/options/network.py @@ -42,7 +42,7 @@ class NetworkOptionsPage(OptionsPage): ] def __init__(self, parent=None): - super(NetworkOptionsPage, self).__init__(parent) + super().__init__(parent) self.ui = Ui_NetworkOptionsPage() self.ui.setupUi(self) diff --git a/picard/ui/options/plugins.py b/picard/ui/options/plugins.py index 4827b5bce..6939ad872 100644 --- a/picard/ui/options/plugins.py +++ b/picard/ui/options/plugins.py @@ -39,7 +39,7 @@ class PluginTreeWidgetItem(HashableTreeWidgetItem): def __lt__(self, other): if (not isinstance(other, PluginTreeWidgetItem)): - return super(PluginTreeWidgetItem, self).__lt__(other) + return super().__lt__(other) tree = self.treeWidget() if not tree: @@ -50,7 +50,7 @@ class PluginTreeWidgetItem(HashableTreeWidgetItem): return self.sortData(column) < other.sortData(column) def __init__(self, *args): - super(PluginTreeWidgetItem, self).__init__(*args) + super().__init__(*args) self._sortData = {} def sortData(self, column): @@ -78,7 +78,7 @@ class PluginsOptionsPage(OptionsPage): ] def __init__(self, parent=None): - super(PluginsOptionsPage, self).__init__(parent) + super().__init__(parent) self.ui = Ui_PluginsOptionsPage() self.ui.setupUi(self) self.items = {} @@ -168,7 +168,7 @@ class PluginsOptionsPage(OptionsPage): # Remove previous entries self._user_interaction(False) self._remove_all() - super(PluginsOptionsPage, self).restore_defaults() + super().restore_defaults() def load(self): self._populate() diff --git a/picard/ui/options/ratings.py b/picard/ui/options/ratings.py index de7e841b5..8b6fa3a8f 100644 --- a/picard/ui/options/ratings.py +++ b/picard/ui/options/ratings.py @@ -38,7 +38,7 @@ class RatingsOptionsPage(OptionsPage): ] def __init__(self, parent=None): - super(RatingsOptionsPage, self).__init__(parent) + super().__init__(parent) self.ui = Ui_RatingsOptionsPage() self.ui.setupUi(self) diff --git a/picard/ui/options/releases.py b/picard/ui/options/releases.py index b27985b74..26e91288a 100644 --- a/picard/ui/options/releases.py +++ b/picard/ui/options/releases.py @@ -96,7 +96,7 @@ class ReleasesOptionsPage(OptionsPage): ] def __init__(self, parent=None): - super(ReleasesOptionsPage, self).__init__(parent) + super().__init__(parent) self.ui = Ui_ReleasesOptionsPage() self.ui.setupUi(self) @@ -143,7 +143,7 @@ class ReleasesOptionsPage(OptionsPage): self.ui.preferred_format_list.clear() self.ui.country_list.clear() self.ui.format_list.clear() - super(ReleasesOptionsPage, self).restore_defaults() + super().restore_defaults() def load(self): scores = dict(config.setting["release_type_scores"]) diff --git a/picard/ui/options/renaming.py b/picard/ui/options/renaming.py index 8adb262cd..114739ff2 100644 --- a/picard/ui/options/renaming.py +++ b/picard/ui/options/renaming.py @@ -65,7 +65,7 @@ class RenamingOptionsPage(OptionsPage): ] def __init__(self, parent=None): - super(RenamingOptionsPage, self).__init__(parent) + super().__init__(parent) self.ui = Ui_RenamingOptionsPage() self.ui.setupUi(self) diff --git a/picard/ui/options/scripting.py b/picard/ui/options/scripting.py index da91cd55b..1730d1482 100644 --- a/picard/ui/options/scripting.py +++ b/picard/ui/options/scripting.py @@ -109,7 +109,7 @@ class AdvancedScriptItem(QtWidgets.QWidget): _BUTTON_OTHER = 4 def __init__(self, name=None, state=True, parent=None): - super(AdvancedScriptItem, self).__init__(parent) + super().__init__(parent) layout = QtWidgets.QGridLayout() layout.setHorizontalSpacing(5) layout.setVerticalSpacing(2) @@ -216,7 +216,7 @@ class ScriptingOptionsPage(OptionsPage): ] def __init__(self, parent=None): - super(ScriptingOptionsPage, self).__init__(parent) + super().__init__(parent) self.ui = Ui_ScriptingOptionsPage() self.ui.setupUi(self) self.highlighter = TaggerScriptSyntaxHighlighter(self.ui.tagger_script.document()) @@ -382,7 +382,7 @@ class ScriptingOptionsPage(OptionsPage): self.ui.script_list.clear() self.ui.script_name.setText("") self.ui.tagger_script.setText("") - super(ScriptingOptionsPage, self).restore_defaults() + super().restore_defaults() def load(self): self.ui.enable_tagger_scripts.setChecked(config.setting["enable_tagger_scripts"]) diff --git a/picard/ui/options/tags.py b/picard/ui/options/tags.py index 7a596a4dc..664b51636 100644 --- a/picard/ui/options/tags.py +++ b/picard/ui/options/tags.py @@ -48,7 +48,7 @@ class TagsOptionsPage(OptionsPage): ] def __init__(self, parent=None): - super(TagsOptionsPage, self).__init__(parent) + super().__init__(parent) self.ui = Ui_TagsOptionsPage() self.ui.setupUi(self) self.ui.write_id3v23.clicked.connect(self.update_encodings) diff --git a/picard/ui/sortablecheckboxlist.py b/picard/ui/sortablecheckboxlist.py index e15f58775..2f47c6f82 100644 --- a/picard/ui/sortablecheckboxlist.py +++ b/picard/ui/sortablecheckboxlist.py @@ -31,7 +31,7 @@ class SortableCheckboxListWidget(QtWidgets.QWidget): changed = pyqtSignal(list) def __init__(self, parent=None): - super(SortableCheckboxListWidget, self).__init__(parent) + super().__init__(parent) layout = QtWidgets.QGridLayout() layout.setHorizontalSpacing(5) layout.setVerticalSpacing(2) diff --git a/picard/ui/util.py b/picard/ui/util.py index f91ee58e0..eb5690d99 100644 --- a/picard/ui/util.py +++ b/picard/ui/util.py @@ -101,7 +101,7 @@ class MultiDirsSelectDialog(QtWidgets.QFileDialog): Depending on the platform, dialog may fallback on non-native. """ def __init__(self, *args): - super(MultiDirsSelectDialog, self).__init__(*args) + super().__init__(*args) self.setFileMode(self.Directory) self.setOption(self.ShowDirsOnly) if sys.platform in ["darwin", "win32"]: diff --git a/picard/util/lrucache.py b/picard/util/lrucache.py index 42c147970..bd5855660 100644 --- a/picard/util/lrucache.py +++ b/picard/util/lrucache.py @@ -38,14 +38,14 @@ class LRUCache(dict): Traceback (most recent call last): File "", line 1, in File "lrucache.py", line 48, in __getitem__ - return super(LRUCache, self).__getitem__(key) + return super().__getitem__(key) KeyError: 'item2' >>> cache['item5'] = 'This will push item3 out of the cache' >>> cache['item3'] Traceback (most recent call last): File "", line 1, in File "lrucache.py", line 48, in __getitem__ - return super(LRUCache, self).__getitem__(key) + return super().__getitem__(key) KeyError: 'item3' >>> cache['item1'] 'some value' @@ -59,21 +59,21 @@ class LRUCache(dict): if key in self: self._ordered_keys.remove(key) self._ordered_keys.insert(0, key) - return super(LRUCache, self).__getitem__(key) + return super().__getitem__(key) def __setitem__(self, key, value): if key in self: self._ordered_keys.remove(key) self._ordered_keys.insert(0, key) - r = super(LRUCache, self).__setitem__(key, value) + r = super().__setitem__(key, value) if len(self) > self._max_size: item = self._ordered_keys.pop() - super(LRUCache, self).__delitem__(item) + super().__delitem__(item) return r def __delitem__(self, key): self._ordered_keys.remove(key) - super(LRUCache, self).__delitem__(key) + super().__delitem__(key) diff --git a/test/test_util_filenaming.py b/test/test_util_filenaming.py index b30fe7cfa..aae612c67 100644 --- a/test/test_util_filenaming.py +++ b/test/test_util_filenaming.py @@ -16,7 +16,7 @@ class ShortFilenameTest(unittest.TestCase): self.max_len = 255 else: self.max_len = os.statvfs("/").f_namemax - super(ShortFilenameTest, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) @unittest.skipUnless(sys.platform in ("win32", "darwin"), "windows / os x test") def test_bmp_unicode_on_unicode_fs(self):