From 6cd4161aa3adfbca6544798158a8b5f006235f6b Mon Sep 17 00:00:00 2001 From: Jean-Christophe Morin <38703886+JeanChristopheMorinPerso@users.noreply.github.com> Date: Mon, 8 Aug 2022 13:37:14 -0400 Subject: [PATCH] Fix lint issues from updated linter (#1370) Signed-off-by: Jean-Christophe Morin --- contrib/opentimelineio_contrib/adapters/extern_rv.py | 2 +- .../opentimelineio_contrib/adapters/hls_playlist.py | 12 ++++++------ .../adapters/tests/test_hls_playlist_adapter.py | 2 +- tests/test_fcp7_xml_adapter.py | 8 ++++---- tests/test_plugin_detection.py | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/contrib/opentimelineio_contrib/adapters/extern_rv.py b/contrib/opentimelineio_contrib/adapters/extern_rv.py index ebba629f2..294993941 100755 --- a/contrib/opentimelineio_contrib/adapters/extern_rv.py +++ b/contrib/opentimelineio_contrib/adapters/extern_rv.py @@ -56,7 +56,7 @@ def execute_rv_commands(simplified_data, to_session): rv_node_index = len(rv_nodes) # make sure that node order lines up - assert(rv_node_index == node["node_index"]) + assert rv_node_index == node["node_index"] rv_nodes.append(new_node) node["rv_node"] = new_node diff --git a/contrib/opentimelineio_contrib/adapters/hls_playlist.py b/contrib/opentimelineio_contrib/adapters/hls_playlist.py index 7612fca27..55aa284bb 100644 --- a/contrib/opentimelineio_contrib/adapters/hls_playlist.py +++ b/contrib/opentimelineio_contrib/adapters/hls_playlist.py @@ -1074,7 +1074,7 @@ def master_playlist_to_string(master_timeline): hls_md_rejectlist = ['master_playlist'] for key in hls_md_rejectlist: try: - del(header_tags[key]) + del header_tags[key] except KeyError: pass @@ -1158,7 +1158,7 @@ def master_playlist_to_string(master_timeline): # Remove entries to not be included for I-Frame streams for attr in I_FRAME_OMIT_ATTRS: try: - del(attribute_list[attr]) + del attribute_list[attr] except KeyError: pass @@ -1316,7 +1316,7 @@ def _copy_HLS_metadata(self, media_track): # Remove the version tag from the track metadata, we'll compute # based on what we write out - del(self._playlist_tags[PLAYLIST_VERSION_TAG]) + del self._playlist_tags[PLAYLIST_VERSION_TAG] except KeyError: pass @@ -1325,7 +1325,7 @@ def _copy_HLS_metadata(self, media_track): # playlist URIs for key in ('uri', 'iframe_uri'): try: - del(self._playlist_tags[key]) + del self._playlist_tags[key] except KeyError: pass @@ -1434,7 +1434,7 @@ def _add_entries_for_segment_from_fragments( omit_hls_keys = omit_hls_keys or [] for key in omit_hls_keys: try: - del(segment_tags[key]) + del segment_tags[key] except KeyError: pass @@ -1462,7 +1462,7 @@ def _add_entries_for_segment_from_fragments( omit_hls_keys = omit_hls_keys or [] for key in omit_hls_keys: try: - del(segment_tags[key]) + del segment_tags[key] except KeyError: pass diff --git a/contrib/opentimelineio_contrib/adapters/tests/test_hls_playlist_adapter.py b/contrib/opentimelineio_contrib/adapters/tests/test_hls_playlist_adapter.py index 3655da32d..13c36d541 100644 --- a/contrib/opentimelineio_contrib/adapters/tests/test_hls_playlist_adapter.py +++ b/contrib/opentimelineio_contrib/adapters/tests/test_hls_playlist_adapter.py @@ -327,7 +327,7 @@ def test_iframe_segment_size(self): # Configure the playlist to be an iframe list track_hls_metadata = timeline.tracks[0].metadata['HLS'] - del(track_hls_metadata['EXT-X-INDEPENDENT-SEGMENTS']) + del track_hls_metadata['EXT-X-INDEPENDENT-SEGMENTS'] track_hls_metadata['EXT-X-I-FRAMES-ONLY'] = None # Write out the playlist diff --git a/tests/test_fcp7_xml_adapter.py b/tests/test_fcp7_xml_adapter.py index 6ee80e5f6..32897ab32 100644 --- a/tests/test_fcp7_xml_adapter.py +++ b/tests/test_fcp7_xml_adapter.py @@ -1287,10 +1287,10 @@ def test_roundtrip_mem2disk2mem(self): # Before comparing, scrub ignorable metadata introduced in # serialization (things like unique ids minted by the adapter) # Since we seeded metadata for the generator, keep that metadata - del(new_timeline.metadata["fcp_xml"]) + del new_timeline.metadata["fcp_xml"] for child in new_timeline.tracks.each_child(): try: - del(child.metadata["fcp_xml"]) + del child.metadata["fcp_xml"] except KeyError: pass @@ -1299,7 +1299,7 @@ def test_roundtrip_mem2disk2mem(self): child.media_reference, schema.GeneratorReference ) if not is_generator: - del(child.media_reference.metadata["fcp_xml"]) + del child.media_reference.metadata["fcp_xml"] except (AttributeError, KeyError): pass @@ -1323,7 +1323,7 @@ def scrub_md_dicts(timeline): def scrub_displayformat(md_dict): for ignore_key in {"link"}: try: - del(md_dict[ignore_key]) + del md_dict[ignore_key] except KeyError: pass diff --git a/tests/test_plugin_detection.py b/tests/test_plugin_detection.py index bb0a8aa92..ddd1f1fd9 100644 --- a/tests/test_plugin_detection.py +++ b/tests/test_plugin_detection.py @@ -68,7 +68,7 @@ def tearDown(self): self.sys_patch.stop() self.entry_patcher.stop() if 'otio_mockplugin' in sys.modules: - del(sys.modules['otio_mockplugin']) + del sys.modules['otio_mockplugin'] def test_detect_plugin(self): """This manifest uses the plugin_manifest function"""