File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,6 @@ def get_schema(version=toolversion, schema_file=SCHEMA_META):
23
23
TODO: In the future load specific schema versions.
24
24
"""
25
25
schema_dir = Path (__file__ ).parent
26
- with open (schema_dir / schema_file , 'rb' ) as handle :
26
+ with open (schema_dir / schema_file , "rb" ) as handle :
27
27
schema = json .load (handle )
28
28
return schema
Original file line number Diff line number Diff line change @@ -837,8 +837,9 @@ def verify_stream_hashes(self) -> None:
837
837
for stream in streams :
838
838
old_hash = stream .get ("hash" )
839
839
metafile_name = get_sigmf_filenames (stream .get ("name" ))["meta_fn" ]
840
- if Path .is_file (metafile_name ):
841
- new_hash = sigmf_hash .calculate_sha512 (filename = metafile_name )
840
+ metafile_path = self .base_path / metafile_name
841
+ if Path .is_file (metafile_path ):
842
+ new_hash = sigmf_hash .calculate_sha512 (filename = metafile_path )
842
843
if old_hash != new_hash :
843
844
raise SigMFFileError (
844
845
f"Calculated file hash for { metafile_path } does not match collection metadata."
@@ -851,7 +852,8 @@ def set_streams(self, metafiles) -> None:
851
852
self .metafiles = metafiles
852
853
streams = []
853
854
for metafile in self .metafiles :
854
- if metafile .endswith (".sigmf-meta" ) and Path .is_file (metafile ):
855
+ metafile_path = self .base_path / metafile
856
+ if metafile .endswith (".sigmf-meta" ) and Path .is_file (metafile_path ):
855
857
stream = {
856
858
# name must be string here to be serializable later
857
859
"name" : str (get_sigmf_filenames (metafile )["base_fn" ]),
You can’t perform that action at this time.
0 commit comments