pgrouphelpers
This commit is contained in:
33
name2pgroups
Executable file
33
name2pgroups
Executable file
@@ -0,0 +1,33 @@
|
||||
#!/sf/bernina/applications/bm/envs/default/bin/python
|
||||
import sys
|
||||
from pathlib import Path
|
||||
name = sys.argv[1]
|
||||
def name2pgrous(name):
|
||||
tp = '/sf/bernina/exp/'
|
||||
d = Path(tp)
|
||||
dirs = [i for i in d.glob('*') if i.is_symlink()]
|
||||
names = [i.name for i in dirs]
|
||||
targets = [i.resolve().name for i in dirs]
|
||||
return [[i_n,i_p] for i_n,i_p in zip(names,targets) if name in i_n]
|
||||
|
||||
for i in name2pgrous(name):
|
||||
print(*i)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
32
pgroup2name
Executable file
32
pgroup2name
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/sf/bernina/applications/bm/envs/default/bin/python
|
||||
import sys
|
||||
from pathlib import Path
|
||||
pgroup = sys.argv[1]
|
||||
def pgroup2name(pgroup):
|
||||
tp = '/sf/bernina/exp/'
|
||||
d = Path(tp)
|
||||
dirs = [i for i in d.glob('*') if i.is_symlink()]
|
||||
names = [i.name for i in dirs]
|
||||
targets = [i.resolve().name for i in dirs]
|
||||
return names[targets.index(pgroup)]
|
||||
|
||||
print(pgroup2name(pgroup))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user