Skip to content

Commit 81391a3

Browse files
committed
FIX: more linting fixes
1 parent ed06c07 commit 81391a3

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

MethodicConfigurator/frontend_tkinter_directory_selection.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ class DirectorySelectionWidgets:
3838

3939
def __init__( # pylint: disable=too-many-arguments
4040
self,
41-
parent,
42-
parent_frame,
41+
parent: tk.Toplevel,
42+
parent_frame: tk.Widget,
4343
initialdir: str,
4444
label_text: str,
4545
autoresize_width: bool,
@@ -175,7 +175,7 @@ def __init__( # pylint: disable=too-many-arguments
175175
self.local_filesystem = local_filesystem
176176
self.destroy_parent_on_open = destroy_parent_on_open
177177

178-
def on_select_directory(self) -> None:
178+
def on_select_directory(self) -> bool:
179179
# Call the base class method to open the directory selection dialog
180180
if super().on_select_directory():
181181
if "vehicle_templates" in self.directory and not self.local_filesystem.allow_editing_template_files:
@@ -186,14 +186,14 @@ def on_select_directory(self) -> None:
186186
"as those are used as a template for new vehicles"
187187
),
188188
)
189-
return
189+
return False
190190
self.local_filesystem.vehicle_dir = self.directory
191191

192192
if not self.local_filesystem.vehicle_configuration_files_exist(self.directory):
193193
_filename = self.local_filesystem.vehicle_components_json_filename
194194
error_msg = _("Selected directory must contain files matching \\d\\d_*\\.param and a {_filename} file")
195195
messagebox.showerror(_("Invalid Vehicle Directory Selected"), error_msg.format(**locals()))
196-
return
196+
return False
197197

198198
try:
199199
self.local_filesystem.re_init(self.directory, self.local_filesystem.vehicle_type)
@@ -207,9 +207,11 @@ def on_select_directory(self) -> None:
207207
LocalFilesystem.store_recently_used_vehicle_dir(self.directory)
208208
if self.destroy_parent_on_open:
209209
self.parent.root.destroy()
210-
return
210+
return True
211211
# No files were found in the selected directory
212212
show_no_param_files_error(self.directory)
213+
return True
214+
return False
213215

214216

215217
class VehicleDirectorySelectionWindow(BaseWindow):

0 commit comments

Comments
 (0)