Skip to content

Commit

Permalink
thread safety (#479)
Browse files Browse the repository at this point in the history
Co-authored-by: Josef Haupt <[email protected]>
  • Loading branch information
Josef-Haupt and Josef Haupt authored Oct 23, 2024
1 parent 4425237 commit bf59bbb
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions birdnet_analyzer/gui/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,14 @@
_CUSTOM_CLASSIFIER = loc.localize("species-list-radio-option-custom-classifier")
_ALL_SPECIES = loc.localize("species-list-radio-option-all")
_WINDOW: webview.Window = None
_HIDDEN_TK = None


# Nishant - Following two functions (select_folder andget_files_and_durations) are written for Folder selection
def select_folder():
from tkinter import Tk, filedialog

global _HIDDEN_TK

if _HIDDEN_TK is None:
_HIDDEN_TK = Tk()
_HIDDEN_TK.withdraw()
tk = Tk()
tk.withdraw()

folder_selected = filedialog.askdirectory()
return folder_selected
Expand Down

0 comments on commit bf59bbb

Please sign in to comment.