2688 shaares
I'm Chao Zhang, you can also call me tokers (it's my nickname), Alex. I'm a guy who loves Open Source. I'm now devoting myself to the API Gateway, Kubernetes, Service Mesh fields. If you want to talk with me, just mail to tokers@apache.org.
import sys
import ruamel.yaml
def recurse(d, pat, rep):
if isinstance(d, dict):
for k in d:
if isinstance(d[k], str):
d[k] = d[k].replace(pat, rep)
else:
recurse(d[k], pat, rep)
if isinstance(d, list):
for idx, elem in enumerate(d):
if isinstance(elem, str):
d[idx] = elem.replace(pat, rep)
else:
recurse(d[idx], pat, rep)
yaml = ruamel.yaml.YAML()
yaml.preserve_quotes = True
with open('in.yaml') as fp:
data = yaml.load(fp)
recurse(data, '<<id>>', 'xy: z') # not that this makes much sense, but it proves a point
yaml.dump(data, sys.stdout)
import ruamel.yaml
def recurse(d, pat, rep):
if isinstance(d, dict):
for k in d:
if isinstance(d[k], str):
d[k] = d[k].replace(pat, rep)
else:
recurse(d[k], pat, rep)
if isinstance(d, list):
for idx, elem in enumerate(d):
if isinstance(elem, str):
d[idx] = elem.replace(pat, rep)
else:
recurse(d[idx], pat, rep)
yaml = ruamel.yaml.YAML()
yaml.preserve_quotes = True
with open('in.yaml') as fp:
data = yaml.load(fp)
recurse(data, '<<id>>', 'xy: z') # not that this makes much sense, but it proves a point
yaml.dump(data, sys.stdout)
apk update && apk add curl openssh-client busybox-extras vim
The library needs the VC v14+ runtime library, not VS build tools. You can get the runtime from the MS downloads page. Install the VS 2015/2017/2019 redist as it is the latest version.
impyla
一路安装就可以
1、pip install six
2、pip install bit_array
3、pip install thriftpy
4、pip install thrift_sasl
5、pip install impyla
1、pip install six
2、pip install bit_array
3、pip install thriftpy
4、pip install thrift_sasl
5、pip install impyla
curl -# -O
System.setProperty('org.apache.commons.jelly.tags.fmt.timeZone', 'Asia/Shanghai')