diff options
author | Karl Berry <karl@freefriends.org> | 2022-05-22 20:22:34 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2022-05-22 20:22:34 +0000 |
commit | 23859d94980a5edd9fe69596997ddf2192c09f58 (patch) | |
tree | 84460f1bd6294644b090b195abc1c23f50ec093a /Master/texmf-dist/source/fonts/gentium-tug/type1/afmcreator.py | |
parent | e520717d2f6648a7c8215368f03a9ea21b962ed0 (diff) |
gentium-tug (22may22)
git-svn-id: svn://tug.org/texlive/trunk@63367 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/fonts/gentium-tug/type1/afmcreator.py')
-rwxr-xr-x | Master/texmf-dist/source/fonts/gentium-tug/type1/afmcreator.py | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/Master/texmf-dist/source/fonts/gentium-tug/type1/afmcreator.py b/Master/texmf-dist/source/fonts/gentium-tug/type1/afmcreator.py index bc44f1cd859..7d81f9f7a1e 100755 --- a/Master/texmf-dist/source/fonts/gentium-tug/type1/afmcreator.py +++ b/Master/texmf-dist/source/fonts/gentium-tug/type1/afmcreator.py @@ -1,22 +1,18 @@ -#! /usr/bin/env python +#! /usr/bin/env python3 # This file is part of the Gentium package for TeX. # It is licensed under the Expat License, see doc//README for details. -import os, sys +import os +import sys creatortext = "Comment Creator: TeX Users Group\n" tempname = "temp.afm" -fin = open(sys.argv[1], "r") -fout = open(tempname, "w") -while True: - s = fin.readline() - if s == "": break # end of file - fout.write(s) - if s.find("Comment Creation Date") == 0 : - fout.write(creatortext) # Creator after Creation Date -fin.close() -fout.close() +with open(sys.argv[1], "r") as fin, open(tempname, "w") as fout: + for line in fin: + fout.write(line) + if line.startswith("Comment Creation Date"): + fout.write(creatortext) # Creator after Creation Date os.rename(tempname, sys.argv[1]) |