Open the right file
This commit is contained in:
parent
7754f17cc9
commit
2a1ed46ddd
|
@ -10,8 +10,9 @@ def open_all():
|
||||||
raise KeyError('$HOME is not set') from err
|
raise KeyError('$HOME is not set') from err
|
||||||
|
|
||||||
# If the directory doesn't exist, just return empty
|
# If the directory doesn't exist, just return empty
|
||||||
|
sshwot_dir_path = os.path.join(homedir, '.sshwot')
|
||||||
try:
|
try:
|
||||||
sshwot_dir = os.listdir(os.path.join(homedir, '.sshwot'))
|
sshwot_dir = os.listdir(sshwot_dir_path)
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
@ -19,6 +20,7 @@ def open_all():
|
||||||
files = []
|
files = []
|
||||||
for dir_entry in sshwot_dir:
|
for dir_entry in sshwot_dir:
|
||||||
if dir_entry.split('.')[-1] == 'sshwot':
|
if dir_entry.split('.')[-1] == 'sshwot':
|
||||||
files.append(open(dir_entry, 'rb'))
|
path = os.path.join(sshwot_dir_path, dir_entry)
|
||||||
|
files.append(open(path, 'rb'))
|
||||||
|
|
||||||
return files
|
return files
|
||||||
|
|
Loading…
Reference in New Issue