Skip to content

Commit

Permalink
update pylint stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Muddyblack committed Jan 10, 2024
1 parent b452b6e commit d6acb77
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 13 deletions.
3 changes: 2 additions & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,8 @@ disable=raw-checker-failed,
deprecated-pragma,
use-symbolic-message-instead,
use-implicit-booleaness-not-comparison-to-string,
use-implicit-booleaness-not-comparison-to-zero
use-implicit-booleaness-not-comparison-to-zero,
broad-except

# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
Expand Down
13 changes: 10 additions & 3 deletions MetaDataEditor/custom_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@ class TagTextEdit(QTextEdit):
Custom QTextEdit that allows tabbing between widgets
"""

# pylint: disable=invalid-name
def keyPressEvent(self, event):
"""Overwrite the keyPressEvent to allow tabbing between widgets"""
if event.key() == Qt.Key_Tab and not event.modifiers():
self.focusNextPrevChild(True)
else:
super().keyPressEvent(event)

# pylint: enable=invalid-name
def event(self, event):
"""Overwrite the event to allow tabbing between widgets"""
if (
Expand All @@ -35,11 +37,14 @@ def event(self, event):
return True
return super().event(event)

# pylint: disable=invalid-name
def focusInEvent(self, event):
"""Overwrite the focusInEvent to select all text"""
super().focusInEvent(event)
self.selectAll()

# pylint: enable=invalid-name


class TagWidget(QWidget):
"""
Expand Down Expand Up @@ -89,15 +94,17 @@ def clear_fields(self):
try:
self.tag_name_edit.clear()
self.tag_value_edit.clear()
except:
except AttributeError:
pass

def remove_self(self):
"""Removes itself from the parent layout"""
try:
self.deleteLater()
except:
pass
except RuntimeError as e:
print(f"RuntimeError: {e}")
except Exception as e:
print(f"An unexpected error occurred: {e}")

def get_values(self):
"""Returns the values of the tag_name_edit and tag_value_edit"""
Expand Down
3 changes: 1 addition & 2 deletions unittests/test_drive_change_detector.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# pylint: disable=C
# pylint: disable=unused-import
# pylint: disable=all
import setup
import json
import unittest
Expand Down
4 changes: 1 addition & 3 deletions unittests/test_drive_connector.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
""" Unit tests for drive_connector.py """
# pylint: disable=C
# pylint: disable=unused-import

# pylint: disable=all
import setup
import unittest
from unittest.mock import patch, MagicMock
Expand Down
4 changes: 2 additions & 2 deletions unittests/test_drive_downloader.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# pylint: disable=C
# pylint: disable=unused-import
# pylint: disable=all

import setup
import os
import unittest
Expand Down
4 changes: 2 additions & 2 deletions unittests/test_show_file_checker.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# pylint: disable=C
# pylint: disable=unused-import
# pylint: disable=all

import setup
import logging
from datetime import datetime
Expand Down

0 comments on commit d6acb77

Please sign in to comment.