style: split out the user list func
This commit is contained in:
parent
7662f289dc
commit
d367127b4e
36
src/users.py
Normal file
36
src/users.py
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
import os
|
||||||
|
|
||||||
|
def get_master():
|
||||||
|
ans = []
|
||||||
|
for year in os.listdir(f'/volume2/m3/master/'):
|
||||||
|
if os.path.isdir(f'/volume2/m3/master/{year}'):
|
||||||
|
for user in os.listdir(f'/volume2/m3/master/{year}'):
|
||||||
|
ans.append(f'/volume2/m3/master/{year}/{user}')
|
||||||
|
for user in os.listdir(f'/volume2/m3/master08'):
|
||||||
|
ans.append(f'/volume2/m3/master08/{user}')
|
||||||
|
for user in os.listdir(f'/volume2/m3/master09'):
|
||||||
|
ans.append(f'/volume2/m3/master09/{user}')
|
||||||
|
return ans
|
||||||
|
|
||||||
|
def get_phd():
|
||||||
|
ans = []
|
||||||
|
for dir_name in os.listdir(f'/volume2/m3/phd/'):
|
||||||
|
if dir_name.isnumeric():
|
||||||
|
year = dir_name
|
||||||
|
for user in os.listdir(f'/volume2/m3/phd/{year}'):
|
||||||
|
ans.append(f'/volume2/m3/phd/{year}/{user}')
|
||||||
|
else:
|
||||||
|
ans.append(f'/volume2/m3/phd/{dir_name}')
|
||||||
|
return ans
|
||||||
|
|
||||||
|
def get_ra():
|
||||||
|
ans = []
|
||||||
|
for user in os.listdir(f'/volume2/m3/ra/'):
|
||||||
|
ans.append(f'/volume2/m3/ra/{user}')
|
||||||
|
return ans
|
||||||
|
|
||||||
|
def get_extra():
|
||||||
|
ans = []
|
||||||
|
for user in os.listdir(f'/volume2/m3/extra/'):
|
||||||
|
ans.append(f'/volume2/m3/extra/{user}')
|
||||||
|
return ans
|
||||||
Loading…
Reference in New Issue
Block a user