@@ -83,23 +83,23 @@ def __init__(
83
83
self .force = force
84
84
# default for saving new request
85
85
# if we're not using a cache
86
- cache_fn = f"mul_ { self .conf ['type' ]} { self .conf ['id' ]} .xml"
86
+ cache_fn = f"{ self .conf ['type' ]} { self .conf ['id' ]} .xml"
87
87
88
88
if cache :
89
89
print ("* loading cached response" )
90
- self .cache = Module (file = cache )
90
+ self .data = Module (file = cache )
91
91
else :
92
92
print ("* launching new search" )
93
- m = self .get_multimedia_for_job ()
94
- m .toFile (path = cache_fn )
95
- self .cache = m
93
+ self .data = self .get_multimedia_for_job ()
94
+ self .data .toFile (path = cache_fn )
96
95
97
96
if self .conf ["attachments" ]["name" ] == "Cornelia" :
98
97
# in this mode we need object data...
99
- self .cache += self ._init_objData ()
100
- self .cache .toFile (path = cache )
98
+ self .data += self ._init_objData ()
99
+ if not cache :
100
+ self .data .toFile (path = cache_fn )
101
101
102
- self .process_response (data = self .cache )
102
+ self .process_response (data = self .data )
103
103
104
104
def process_response (self , * , data : Module ) -> None :
105
105
print ("* processing response" )
@@ -248,7 +248,7 @@ def _get_single_attachment(self, *, item, ID: int, out_dir: Path) -> None:
248
248
249
249
match self .conf ["attachments" ]["name" ]:
250
250
case "Cornelia" :
251
- res = self .cache .xpath (f"""
251
+ res = self .data .xpath (f"""
252
252
/m:application/m:modules/m:module[
253
253
@name = 'Object'
254
254
]/m:moduleItem/m:moduleReference[
@@ -296,21 +296,17 @@ def _get_out_dir(self) -> Path:
296
296
return out_dir
297
297
298
298
def _init_objData (self ) -> None :
299
- obj_fn = Path (f"obj_{ self .conf ['type' ]} { self .conf ['id' ]} .xml" )
300
- if self .cache :
301
- if self .cache .actualSize (module = "Object" ) > 0 :
299
+ # obj_fn = Path(f"obj_{self.conf['type']}{self.conf['id']}.xml")
300
+ if self .data :
301
+ if self .data .actualSize (module = "Object" ) > 0 :
302
302
return Module ()
303
- if self .cache .exists ():
304
- objData = Module (file = str (self .cache ))
305
- elif obj_fn .exists ():
306
- objData = Module (file = obj_fn )
307
303
else :
308
304
print ("getting objData from fresh query" )
309
305
if self .conf ["type" ] == "query" :
310
306
objData = self .api .runSavedQuery2 (Type = "query" , ID = self .conf ["id" ])
311
307
else :
312
308
objData = self ._get_obj_group (grpId = self .conf ["id" ])
313
- objData .toFile (path = obj_fn )
309
+ # objData.toFile(path=obj_fn)
314
310
return objData
315
311
316
312
def _qm_type (self , * , query : Search , Id : int ):
0 commit comments