mrneuralnet commited on
Commit
7fb6afa
·
1 Parent(s): b5a5217

Modify filepicker

Browse files
Files changed (1) hide show
  1. file_picker.py +4 -2
file_picker.py CHANGED
@@ -17,7 +17,8 @@ def update_dir(key):
17
  if os.path.isdir(os.path.join(st.session_state[key+'curr_dir'], choice)):
18
  st.session_state[key+'curr_dir'] = os.path.normpath(os.path.join(st.session_state[key+'curr_dir'], choice))
19
  files = sorted(os.listdir(st.session_state[key+'curr_dir']))
20
- files.remove("images")
 
21
  st.session_state[key+'files'] = files
22
 
23
  def st_file_selector(st_placeholder, path='.', label='Select a file/folder', key = 'selected'):
@@ -28,7 +29,8 @@ def st_file_selector(st_placeholder, path='.', label='Select a file/folder', key
28
 
29
  files = sorted(os.listdir(base_path))
30
  files.insert(0, 'Choose a file...')
31
- files.remove("images")
 
32
  st.session_state[key+'files'] = files
33
  st.session_state[key+'curr_dir'] = base_path
34
  else:
 
17
  if os.path.isdir(os.path.join(st.session_state[key+'curr_dir'], choice)):
18
  st.session_state[key+'curr_dir'] = os.path.normpath(os.path.join(st.session_state[key+'curr_dir'], choice))
19
  files = sorted(os.listdir(st.session_state[key+'curr_dir']))
20
+ if "images" in files:
21
+ files.remove("images")
22
  st.session_state[key+'files'] = files
23
 
24
  def st_file_selector(st_placeholder, path='.', label='Select a file/folder', key = 'selected'):
 
29
 
30
  files = sorted(os.listdir(base_path))
31
  files.insert(0, 'Choose a file...')
32
+ if "images" in files:
33
+ files.remove("images")
34
  st.session_state[key+'files'] = files
35
  st.session_state[key+'curr_dir'] = base_path
36
  else: