File: //proc/4052527/root/tmp/fix_links_marinho.py
path_css = "/home/kohlsol/public_html/wp-content/themes/brooklyn-child/style.css"
with open(path_css) as f:
content = f.read()
old = """a {
color: var(--kohl-marinho);
}
a:hover {
color: var(--kohl-champagne-escuro);
}"""
new = """a {
color: var(--kohl-marinho);
}
a:hover {
color: var(--kohl-champagne-escuro);
}
.kohl-bg-marinho a {
color: var(--kohl-champagne);
}
.kohl-bg-marinho a:hover {
color: var(--kohl-branco);
}"""
assert content.count(old) == 1, "css: padrao nao encontrado"
content = content.replace(old, new)
with open(path_css, "w") as f:
f.write(content)
path_fn = "/home/kohlsol/public_html/wp-content/themes/brooklyn-child/functions.php"
with open(path_fn) as f:
fn = f.read()
old2 = """\t\t.kohl-bg-marinho .bklyn-btn:hover, .kohl-bg-marinho .bklyn-btn:focus {
\t\t\tbackground-color: var(--kohl-champagne) !important;
\t\t\tborder-color: var(--kohl-champagne) !important;
\t\t\tcolor: var(--kohl-marinho) !important;
\t\t}"""
new2 = old2 + """
\t\t.kohl-bg-marinho a {
\t\t\tcolor: var(--kohl-champagne) !important;
\t\t}
\t\t.kohl-bg-marinho a:hover {
\t\t\tcolor: var(--kohl-branco) !important;
\t\t}"""
assert fn.count(old2) == 1, "functions: padrao nao encontrado"
fn = fn.replace(old2, new2)
with open(path_fn, "w") as f:
f.write(fn)
print("links em fundo marinho corrigidos (champagne, hover branco)")