@@ -165,16 +165,21 @@ def inlist(argp):
165
165
cwd = os .getcwd ()
166
166
curr_cals = autonicer .get_caldb_ver ()
167
167
try :
168
- df = pd .read_csv (f"{ argp .inlist } " )
169
- for i in df ["Input" ]:
170
- path_sep = i .split ("/xti/event_cl/" )
171
- os .chdir (path_sep [0 ])
172
- if argp .checkcal is True or argp .reprocess is True :
173
- reprocess_check (argp , curr_cals )
174
- os .chdir (cwd )
168
+ if len (argp .inlist ) == 1 :
169
+ df = pd .read_csv (f"{ argp .inlist [0 ]} " )
170
+ for i in df ["Input" ]:
171
+ path_sep = i .split ("/xti/event_cl/" )
172
+ os .chdir (path_sep [0 ])
173
+ if argp .checkcal is True or argp .reprocess is True :
174
+ reprocess_check (argp , curr_cals )
175
+ os .chdir (cwd )
176
+ else :
177
+ raise FileNotFoundError
175
178
176
179
except FileNotFoundError :
177
- dirs = glob .glob (f"{ argp .inlist } " )
180
+ dirs = argp .inlist
181
+ if len (argp .inlist ) == 1 :
182
+ dirs = glob .glob (f"{ argp .inlist [0 ]} " )
178
183
if len (dirs ) != 0 :
179
184
for i in dirs :
180
185
try :
@@ -188,7 +193,7 @@ def inlist(argp):
188
193
else :
189
194
print (colored (f"DATASETS NOT FOUND" , "red" ))
190
195
except pd .errors .ParserError :
191
- print (colored (f"Unable to resolve --inlist { argp .inlist } " , "red" ))
196
+ print (colored (f"Unable to resolve --inlist { argp .inlist [ 0 ] } " , "red" ))
192
197
except KeyError :
193
- print (colored (f"{ argp .inlist } format not readable" , "red" ))
198
+ print (colored (f"{ argp .inlist [ 0 ] } format not readable" , "red" ))
194
199
print ("Format must be csv with Input column for inlist files..." )
0 commit comments