Преглед изворни кода

Exclude .DS_Store files from registry

sfmig пре 1 година
родитељ
комит
df3cc5dfbf
2 измењених фајлова са 7 додато и 3 уклоњено
  1. 0 3
      files-registry.txt
  2. 7 0
      get_sha256_hashes.py

+ 0 - 3
files-registry.txt

@@ -1,11 +1,8 @@
-.DS_Store ebd37c6ba8e596dd1be0d4017cb4e045bcf28323c1379396609a85ba666f2dba
 README.md 4cafa4a8e87200e12bf4dfdd09d7173f2522a4738d66fc495ff217afae6a7e0a
-test_annotations/.DS_Store 8a281335718cf493fdc0420b3decc81d4a2b8c7954c86b15309fb43b3d4cf347
 test_annotations/medium_bboxes_dataset_COCO/COCO_JSON_sample_1.json 8bdea1ed408aaf6ad5eb8deed2f47c16fcff35697ad4983f59afb7462de9c5df
 test_annotations/medium_bboxes_dataset_COCO/COCO_JSON_sample_2.json 7ea3d6d152921294e0ab71740249c87eb5aecbb95a2b6554ab3e89a1d4e59b82
 test_annotations/medium_bboxes_dataset_VIA/VIA_JSON_sample_1.json 3d197d8fbd6121a32d729486c7511eb6d8451371a67fbae791a2309f27c8fb19
 test_annotations/medium_bboxes_dataset_VIA/VIA_JSON_sample_2.json d2162c26bcd3e1d543155208069c3fa42ef60302f56088e0ee4bb5fd164f7213
-test_annotations/sample_external_COCO_files/.DS_Store a322048a9a4baa73b171f110d9cd6092228910d8cc8401aa229d892944ef6eeb
 test_annotations/sample_external_COCO_files/ACTD_1_Terrestrial_group_data_CCT.json 41d6d7655b1c34184dee6b204ec0e1cb4b0afaa2f4da35cc27d354312467d4ce
 test_annotations/sample_external_COCO_files/SnapshotSerengetiBboxes_20190903.json 665a5f04a9f167482bfb6fd8a4893d3bc56e6f6ced5bb8add37aff8372940e6f
 test_annotations/small_bboxes_dataset/small_bboxes_COCO.json c68faaf3b51282841b82e2ffe2925985ad6fdc8a4f01351a519c689e8d3be675

+ 7 - 0
get_sha256_hashes.py

@@ -7,3 +7,10 @@ if __name__ == "__main__":
         "test_data",
         "files-registry.txt",  # destination file
     )
+
+    # Remove .DS_Store files from the file registry
+    with open("files-registry.txt", "r+") as f:
+        lines = [line for line in f if ".DS_Store" not in line]
+        f.seek(0)  # move pointer to the start of the file
+        f.truncate()  # delete from the pointer to the end 
+        f.writelines(lines)