MCPcopy
hub / github.com/mne-tools/mne-python / main

Function main

tools/dev/gen_css_for_mne.py:31–53  ·  view source on GitHub ↗

Start the CSS modification.

()

Source from the content-addressed store, hash-verified

29
30
31def main():
32 """Start the CSS modification."""
33 css_in = css_path_in.read_text(encoding="utf-8")
34 font_binary = font_path.read_bytes()
35 font_b64 = base64.b64encode(font_binary).decode("utf-8")
36
37 css_out = []
38 for css in css_in.split("\n"):
39 if "src: url(" in css:
40 css = (
41 f" src: url(data:font/woff2;charset=utf-8;"
42 f'base64,{font_b64}) format("woff2");'
43 )
44 elif "url(" in css:
45 continue
46
47 css_out.append(css)
48
49 css_out = "\n".join(css_out)
50 css_minified_out = rcssmin.cssmin(style=css_out)
51
52 css_path_out.write_text(data=css_out, encoding="utf-8")
53 css_minified_path_out.write_text(data=css_minified_out, encoding="utf-8")
54
55
56if __name__ == "__main__":

Callers 1

gen_css_for_mne.pyFile · 0.70

Calls 2

splitMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected