-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathutils.py
More file actions
56 lines (47 loc) · 1.74 KB
/
Copy pathutils.py
File metadata and controls
56 lines (47 loc) · 1.74 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
50
51
52
53
54
55
56
"""stores utils that are shared between scripts"""
import os
import argparse
from internal.config import config
def get_talents(args):
"""lookup talents based on current config"""
if args.talents:
talents = [args.talents]
elif config["sims"][args.dir]["builds"]:
talents = config["builds"].keys()
else:
talents = []
return talents
def get_covenant(args):
"""lookup covenant based on current config"""
if args.covenant:
covenants = [args.covenant]
elif config["sims"][args.dir]["covenant"]["lookup"]:
covenants = config["covenants"]["list"]
else:
covenants = []
return covenants
def get_simc_dir(talent, covenant, folder_name):
"""get proper directory based on talent and covenant options"""
if covenant:
if talent:
return os.path.join(folder_name, talent, covenant)
return os.path.join(folder_name, covenant)
if talent:
return os.path.join(folder_name, talent)
return folder_name
def generate_parser(description):
"""creates the shared argparser for sim.py and profiles.py"""
parser = argparse.ArgumentParser(description=description)
parser.add_argument('dir', help='Directory to generate profiles for.')
parser.add_argument(
'--dungeons', help='Run a dungeonsimming batch of sims.', action='store_true')
parser.add_argument(
'--talents', help='indicate talent build for output.', choices=config["builds"].keys())
parser.add_argument(
'--covenant',
help='indicate covenant build for output.',
choices=config["covenants"]["list"]
)
parser.add_argument(
'--ptr', help='indicate if the sim should use ptr data.', action='store_true')
return parser