File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import argparse
2+ import time
23from pathlib import Path
34from typing import Union
45
56from const_utils .arguments import Arguments
67from const_utils .default_values import AppSettings
78from const_utils .parser_help import HelpStrings
89from file_operations .file_operation import FileOperation
10+ from services .timeout import wait
911from tools .mixins .file_remover import FileRemoverMixin
1012
1113
@@ -80,6 +82,8 @@ def do_task(self) -> None:
8082
8183 self .logger .info (f"Removed { orphans_removed } orphan annotations" )
8284
85+ wait (logger = self .logger , timeout = self .sleep )
86+
8387
8488 @property
8589 def a_source (self ) -> Path :
Original file line number Diff line number Diff line change 11import argparse
2+ import time
3+
24from const_utils .arguments import Arguments
35from const_utils .copmarer import Constants
46from const_utils .default_values import AppSettings
57from const_utils .parser_help import HelpStrings
68from file_operations .file_operation import FileOperation
9+ from services .timeout import wait
710from tools .mixins .file_remover import FileRemoverMixin
811from tools .comparer .img_comparer .img_comparer import ImageComparer
912
@@ -99,7 +102,9 @@ def do_task(self):
99102 self .logger .info (f"Found { duplicates_count } duplicates in { len (self .files_for_task )} files" )
100103
101104 if duplicates_count > 0 and self .confirm_removing ():
102- self .remove_all (duplicates )
105+ self .remove_all (duplicates )
106+
107+ wait (logger = self .logger , timeout = self .sleep )
103108
104109 def confirm_removing (self ) -> bool :
105110 """
Original file line number Diff line number Diff line change 1+ import logging
2+ import time
3+
4+ def wait (logger : logging .Logger , timeout : float ):
5+ """
6+ Waits until timeout occurs. Logs exception while waiting until timeout occurs.
7+
8+ Args:
9+ logger (logging.Logger): Logger to wait until timeout occurs.
10+ timeout (float): Timeout in seconds.
11+ """
12+ logger .info (f" Wait for { timeout } seconds...\n " )
13+ time .sleep (timeout )
Original file line number Diff line number Diff line change 5656 Commands .stats : [
5757 "data_forge.py" ,
5858 "stats" ,
59- "./media/Pascal VOC 2012.v1-raw.voc/" ,
60- # "./media/annotated/",
59+ # "./media/Pascal VOC 2012.v1-raw.voc/",
60+ "./media/annotated/" ,
6161 "-p" , ".xml" ,
6262 "--destination-type" , "voc" ,
6363 ]
You can’t perform that action at this time.
0 commit comments