Skip to content

Commit

Permalink
Upgrade pylint and fix some warnings (#223)
Browse files Browse the repository at this point in the history
* Ran pylint and fixed some things.

* Upgrade pylintrc and fix many warnings from pylint
  • Loading branch information
PiispaH authored Jul 26, 2024
1 parent 90e447c commit 35e6e0b
Show file tree
Hide file tree
Showing 81 changed files with 912 additions and 786 deletions.
2 changes: 1 addition & 1 deletion bin/append_license.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def _append_license_py(path):

def _append_license_xml(path):
"""Appends a license header to given .py, .ui or .xml file."""
xml_license = list()
xml_license = []
xml_license.append("<!--\n")
for line in license_text:
xml_license.append(line.replace("/", "\\/"))
Expand Down
12 changes: 6 additions & 6 deletions bin/build_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
def find_ui_dirs(path, found_dirs=None):
"""Recursively searches for 'ui' directories and returns their paths as a list."""
if found_dirs is None:
found_dirs = list()
found_dirs = []
for entry in os.scandir(path):
if entry.is_dir():
if entry.name == "ui":
Expand All @@ -20,7 +20,7 @@ def find_ui_dirs(path, found_dirs=None):

def fix_resources_imports(path):
"""Fixes resources imports in a given automatically generated Python ui file."""
lines = list()
lines = []
with open(path, "r") as in_file:
for line in in_file:
if line == "from . import resources_icons_rc\n":
Expand Down Expand Up @@ -73,8 +73,8 @@ def build_qrc(input_path, output_path, force):
ui_dirs = find_ui_dirs(project_source_dir)
for ui_dir in ui_dirs:
print(f"--- Entering {os.path.abspath(ui_dir)} ---")
ui_entries = list()
py_entries = dict()
ui_entries = []
py_entries = {}
for entry in os.scandir(ui_dir):
if entry.is_file():
base, extension = os.path.splitext(entry.name)
Expand All @@ -95,8 +95,8 @@ def build_qrc(input_path, output_path, force):
if ui_modification_time > py_modification_time:
build_ui(ui_entry.path, py_entry.path, args.force)
resources_dir = os.path.join(project_source_dir, "ui", "resources")
qrc_entries = list()
py_paths = dict()
qrc_entries = []
py_paths = {}
for entry in os.scandir(resources_dir):
if entry.is_file():
base, extension = os.path.splitext(entry.name)
Expand Down
Loading

0 comments on commit 35e6e0b

Please sign in to comment.