components/exo/wayland/compatibility_test/wayland_protocol_codegen.py
def write_if_changed(source_text: str, output: str) -> str:
    """Writes source_text to output, but only if different."""
    if os.path.exists(output):
        with open(output, 'rt') as infile:
            if infile.read() == source_text:
                return

    with open(output, 'wt') as outfile:
        outfile.write(source_text)
Writes source_text to output, but only if different.
Writes source_text to output, but only if different.
Writes source_text to output but only if different .
def write_if_changed(source_text: str, output: str) -> str:
    if os.path.exists(output):
        with open(output, 'rt') as infile:
            if infile.read() == source_text:
                return
    with open(output, 'wt') as outfile:
        outfile.write(source_text)
def write_if_changed ( source_text : str , output : str ) -> str : if os . path . exists ( output ) : with open ( output , 'rt' ) as infile : if infile . read ( ) == source_text : return with open ( output , 'wt' ) as outfile : outfile . write ( source_text )
Writes source_text to output, but only if different.
Writes source_text to output but only if different .
"""Writes source_text to output, but only if different."""
source_text
str
output
str