Skip to content

Commit ebf8093

Browse files
committed
Refactor file path usage for parameter and maxtime files
Signed-off-by: Prasanna <iprasannamb@gmail.com>
1 parent 11acdce commit ebf8093

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

concoredocker.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@ def safe_literal_eval(filename, defaultValue):
2121
inpath = os.path.abspath("/in")
2222
outpath = os.path.abspath("/out")
2323
simtime = 0
24+
concore_params_file = os.path.join(inpath, "1", "concore.params")
25+
concore_maxtime_file = os.path.join(inpath, "1", "concore.maxtime")
2426

2527
#9/21/22
2628
try:
27-
sparams = open(os.path.join(inpath, "1", "concore.params")).read()
29+
sparams = open(concore_params_file).read()
2830
if sparams[0] == '"': #windows keeps "" need to remove
2931
sparams = sparams[1:]
3032
sparams = sparams[0:sparams.find('"')]
@@ -46,7 +48,7 @@ def tryparam(n, i):
4648
#9/12/21
4749
def default_maxtime(default):
4850
global maxtime
49-
maxtime = safe_literal_eval(os.path.join(inpath, "1", "concore.maxtime"), default)
51+
maxtime = safe_literal_eval(concore_maxtime_file, default)
5052

5153
default_maxtime(100)
5254

0 commit comments

Comments
 (0)