@@ -747,25 +747,36 @@ def transcribe(src, dst, filename, subtitle_format, main_window):
747747
748748 if not_transcribing : return
749749
750- for t in all_threads :
751- if t .is_alive ():
752- all_tasks_completed = False
753- else :
754- all_tasks_completed = True
755- pool .close ()
756- pool .join ()
757- pool = None
758- os .remove (wav_filename )
759- not_transcribing = True
760- main_window ['-START-' ].update (('Cancel' ,'Start' )[not_transcribing ], button_color = (('white' , ('red' , '#283b5b' )[not_transcribing ])))
750+ if len (all_threads ) > 1 :
751+ for t in all_threads :
752+ if t .is_alive ():
753+ all_tasks_completed = False
754+ else :
755+ all_tasks_completed = True
756+ pool .close ()
757+ pool .join ()
758+ pool = None
759+ t .join ()
760+ os .remove (wav_filename )
761+ not_transcribing = True
762+ main_window ['-START-' ].update (('Cancel' ,'Start' )[not_transcribing ], button_color = (('white' , ('red' , '#283b5b' )[not_transcribing ])))
763+ else :
764+ pool .close ()
765+ pool .join ()
766+ pool = None
767+ os .remove (wav_filename )
768+ not_transcribing = True
769+ main_window ['-START-' ].update (('Cancel' ,'Start' )[not_transcribing ], button_color = (('white' , ('red' , '#283b5b' )[not_transcribing ])))
761770
762771
763772def pBar (count_value , total , prefix , main_window ):
764773 bar_length = 10
765774 filled_up_Length = int (round (bar_length * count_value / (total )))
766775 percentage = round (100.0 * count_value / (total ),1 )
767- bar = '#' * filled_up_Length + '=' * (bar_length - filled_up_Length )
768- text = str ('%s[%s] %s%s\r ' % (prefix , bar , int (percentage ), '%' ))
776+ #bar = '#' * filled_up_Length + '=' * (bar_length - filled_up_Length)
777+ bar = '█' * filled_up_Length + '-' * (bar_length - filled_up_Length )
778+ #text = str('%s[%s] %s%s\r' %(prefix, bar, int(percentage), '%'))
779+ text = str ('%s|%s| %s%s\r ' % (prefix , bar , int (percentage ), '%' ))
769780 main_window ['-OUTPUT-MESSAGES-' ].update (text , append = False )
770781
771782
@@ -788,7 +799,7 @@ def main():
788799 parser .add_argument ('-S' , '--src-language' , help = "Voice language" , default = "en" )
789800 parser .add_argument ('-D' , '--dst-language' , help = "Desired language for translation" , default = "en" )
790801 parser .add_argument ('-F' , '--format' , help = "Destination subtitle format" , default = "srt" )
791- parser .add_argument ('-v' , '--version' , action = 'version' , version = '0.1.2 ' )
802+ parser .add_argument ('-v' , '--version' , action = 'version' , version = '0.1.3 ' )
792803 parser .add_argument ('-lf' , '--list-formats' , help = "List all available subtitle formats" , action = 'store_true' )
793804 parser .add_argument ('-ll' , '--list-languages' , help = "List all available source/translation languages" , action = 'store_true' )
794805
0 commit comments