update controller image and some dependencies

This commit is contained in:
Grant Limberg 2022-06-22 15:03:19 -07:00
commit 183a9d7088
No known key found for this signature in database
GPG key ID: 8F2F97D3BE8D7735
667 changed files with 173907 additions and 17 deletions

View file

@ -0,0 +1,70 @@
#! /usr/bin/env python3
"""M4-quote text, for use as a literal in configure.ac.
Produces M4 "code" which evaluates to the input text.
It's not easy to read plain text from an input file in M4, without having it
expanded as M4. Sometimes all we want is literal text!
"""
from __future__ import (
absolute_import,
print_function,
unicode_literals,
)
from argparse import ArgumentParser
from sys import (
stdin,
stdout,
)
def parse_args():
parser = ArgumentParser(description=__doc__)
parser.add_argument(
'--open', '-a', default='[[', help="Current open-quote symbol.")
parser.add_argument(
'--close', '-b', default=']]', help="Current close-quote symbol.")
parser.add_argument(
'--input', '-i', default='-', help="Input file, or '-' for stdin.")
parser.add_argument(
'--output', '-o', default='-', help="Output file, or '-' for stdout.")
return parser.parse_args()
def open_input(in_file):
if in_file == '-':
return stdin
else:
return open(in_file)
def open_output(out_file):
if out_file == '-':
return stdout
else:
return open(out_file, 'w')
def escape(line):
return (
line
.replace('[', '@<:@')
.replace(']', '@:>@')
.replace('#', '@%:@')
.replace('$', '@S|@')
)
def main(args):
with open_input(args.input) as istr, open_output(args.output) as ostr:
ostr.write(args.open)
for line in istr:
ostr.write(escape(line))
ostr.write('\n')
ostr.write(args.close)
if __name__ == '__main__':
main(parse_args())