-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathafb-deploy.py
More file actions
49 lines (40 loc) · 1.4 KB
/
afb-deploy.py
File metadata and controls
49 lines (40 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env python3
import argparse
import sys,os
#import abinit.fallbacks.sequence as afb_seq
#import abinit.fallbacks.package as afb_pkg
from abinit.fallbacks import sequence
from abinit.fallbacks import package
########################################
# Declare command-line arguments
parser = argparse.ArgumentParser()
#parser.add_argument("action",
# help="Fallback action to perform")
parser.add_argument("-a", "--abinit", metavar="VERSION",
help="Select Abinit version X.Y")
parser.add_argument("-c", "--cfgdir",
help="Look for config files in specified config directory")
parser.add_argument("-f", "--filter", metavar="PACKAGES",
help="Only consider the comma-separated list of packages")
parser.add_argument("-p", "--prefix", metavar="DIRECTORY",
help="Installation prefix for the fallbacks")
args = parser.parse_args()
# Process command-line arguments
if ( args.abinit ):
abinit_version = args.abinit
else:
abinit_version = None
if ( args.cfgdir ):
cfgdir = args.cfgdir
else:
cfgdir = os.path.join("config", "specs")
if ( args.filter ):
fbk_filter = args.filter.split(",")
else:
fbk_filter = None
# Create sequence for requested packages
#fbk_seq = sequence.FallbackSequence(cfgdir, abinit_version, fbk_filter)
#print(fbk_seq)
#fbk_pck = package.FallbackPackage(cfgdir, "atompaw")
fbk_pck = package.FallbackPackage(cfgdir, fbk_filter)
print(fbk_pck)