Skip to content

Commit

Permalink
Conforming to pylint (#2901)
Browse files Browse the repository at this point in the history
* Ran pylint and fixed some things.

* Continue to conform to the desires of pylint

* Remove old pylintrc

* Convert lambdas to def due to pylint
  • Loading branch information
PiispaH authored Jul 24, 2024
1 parent bcd4188 commit b849045
Show file tree
Hide file tree
Showing 108 changed files with 1,285 additions and 1,164 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 @@ -71,8 +71,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 @@ -93,8 +93,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 b849045

Please sign in to comment.