Fix verb tense and missing file.close()

This commit is contained in:
Augusto Gunsch 2021-11-14 18:32:10 -03:00
parent 7c26c27973
commit 732692d3d6
No known key found for this signature in database
GPG Key ID: F7EEFE29825C72DC
1 changed files with 5 additions and 4 deletions

View File

@ -186,6 +186,7 @@ def process_file(args, file):
output = open(file.name, 'w', encoding='utf-8') output = open(file.name, 'w', encoding='utf-8')
output.write(contents) output.write(contents)
output.write(os.linesep) output.write(os.linesep)
output.close()
def main(): def main():
@ -196,7 +197,7 @@ def main():
parser.add_argument( parser.add_argument(
'-c', '--clean', '-c', '--clean',
help='removes subtitles matching regular expressions ' + help='remove subtitles matching regular expressions ' +
'listed in ~/.config/fsubrc (this is the default ' + 'listed in ~/.config/fsubrc (this is the default ' +
'behavior if no other flag is passed)', 'behavior if no other flag is passed)',
action='store_true' action='store_true'
@ -204,7 +205,7 @@ def main():
parser.add_argument( parser.add_argument(
'-s', '--shift', '-s', '--shift',
help='shifts all subtitles by MS milliseconds, which ' + help='shift all subtitles by MS milliseconds, which ' +
'may be positive or negative', 'may be positive or negative',
metavar='MS', metavar='MS',
action='store', action='store',
@ -213,13 +214,13 @@ def main():
parser.add_argument( parser.add_argument(
'-n', '--no-html', '-n', '--no-html',
help='strips HTML tags from subtitles content', help='strip HTML tags from subtitles content',
action='store_true' action='store_true'
) )
parser.add_argument( parser.add_argument(
'-f', '--config-file', '-f', '--config-file',
help='overwrites the default config file (~/.config/fsubrc)', help='overwrite the default config file (~/.config/fsubrc)',
metavar='FILE', metavar='FILE',
action='store', action='store',
type=argparse.FileType('r') type=argparse.FileType('r')