3 # Copyright (C) 2023 Red Hat, Inc.
5 # SPDX-License-Identifier: GPL-2.0-or-later
13 basename
= os
.path
.basename(file_path
)
14 varname
= basename
.replace('-', '_').replace('.', '_')
16 with os
.fdopen(sys
.stdout
.fileno(), "wt", closefd
=False, newline
='\n') as stdout
:
17 with
open(file_path
, "r", encoding
='utf-8') as file:
18 print(f
'static GLchar {varname}_src[] =', file=stdout
)
21 print(f
' "{line}\\n"', file=stdout
)
22 print(' "\\n";', file=stdout
)
25 if __name__
== '__main__':
26 sys
.exit(main(sys
.argv
))