@@ -514,8 +514,7 @@ def declare_file(self, value):
514
514
if not entity and 'location' in value :
515
515
location = str (value ['location' ])
516
516
# If we made it here, we'll have to add it to the RO
517
- assert self .research_object .make_fs_access
518
- fsaccess = self .research_object .make_fs_access ("" )
517
+ fsaccess = StdFsAccess ("" )
519
518
with fsaccess .open (location , "rb" ) as fhandle :
520
519
relative_path = self .research_object .add_data_file (fhandle )
521
520
# FIXME: This naively relies on add_data_file setting hash as filename
@@ -605,8 +604,7 @@ def declare_directory(self, value): # type: (MutableMapping) -> ProvEntity
605
604
is_empty = True
606
605
607
606
if not "listing" in value :
608
- assert self .research_object .make_fs_access
609
- fsaccess = self .research_object .make_fs_access ("" )
607
+ fsaccess = StdFsAccess ("" )
610
608
get_listing (fsaccess , value )
611
609
for entry in value .get ("listing" , []):
612
610
is_empty = False
@@ -943,10 +941,9 @@ def finalize_prov_profile(self, name):
943
941
class ResearchObject ():
944
942
"""CWLProv Research Object."""
945
943
946
- def __init__ (self , make_fs_access , temp_prefix_ro = "tmp" , orcid = '' , full_name = '' ):
947
- # type: (Callable[[Text], StdFsAccess], str, Text, Text) -> None
944
+ def __init__ (self , temp_prefix_ro = "tmp" , orcid = '' , full_name = '' ):
945
+ # type: (str, Text, Text) -> None
948
946
949
- self .make_fs_access = make_fs_access
950
947
self .temp_prefix = temp_prefix_ro
951
948
self .orcid = '' if not orcid else _valid_orcid (orcid )
952
949
self .full_name = full_name
@@ -1553,7 +1550,7 @@ def _relativise_files(self, structure):
1553
1550
# Register in RO; but why was this not picked
1554
1551
# up by used_artefacts?
1555
1552
_logger .info ("[provenance] Adding to RO %s" , structure ["location" ])
1556
- fsaccess = self . make_fs_access ("" )
1553
+ fsaccess = StdFsAccess ("" )
1557
1554
with fsaccess .open (structure ["location" ], "rb" ) as fp :
1558
1555
relative_path = self .add_data_file (fp )
1559
1556
checksum = posixpath .basename (relative_path )
0 commit comments