Commit 0599ee40 authored by Gliczy's avatar Gliczy
Browse files

signal-desktop-bin: cleanup `copy-noto-emoji.py`

parent 81ce4062
Loading
Loading
Loading
Loading
+0 −29
Original line number Diff line number Diff line
@@ -55,21 +55,6 @@ def emoji_to_noto_name(emoji: str) -> str:
    )


def emoji_to_emoji_data_name(emoji: str) -> str:
    r"""Return the npm emoji-data emoji name of an emoji.

    emoji-data emoji names are hyphen‐minus‐separated Unicode scalar
    values, represented in lowercase big‐endian hex padded to at least
    four digits.

    >>> emoji_to_emoji_data_name("😶‍🌫️")
    '1f636-200d-1f32b-fe0f'
    >>> emoji_to_emoji_data_name("\U0001f636\u200d\U0001f32b\ufe0f")
    '1f636-200d-1f32b-fe0f'
    """
    return "-".join(f"{ord(scalar_value):04x}" for scalar_value in emoji)


def _main() -> None:
    noto_png_path, asar_root = (Path(arg) for arg in sys.argv[1:])
    asar_root = asar_root.absolute()
@@ -77,16 +62,6 @@ def _main() -> None:
    out_path = asar_root / "images" / "nixpkgs-emoji"
    out_path.mkdir(parents=True)

    emoji_data_out_path = (
        asar_root
        / "node_modules"
        / "emoji-datasource-apple"
        / "img"
        / "apple"
        / "64"
    )
    emoji_data_out_path.mkdir(parents=True)

    jumbomoji_json_path = asar_root / "build" / "jumbomoji.json"
    with jumbomoji_json_path.open() as jumbomoji_json_file:
        jumbomoji_packs = json.load(jumbomoji_json_file)
@@ -107,10 +82,6 @@ def _main() -> None:
                )
                continue

            (
                emoji_data_out_path / f"{emoji_to_emoji_data_name(emoji)}.png"
            ).symlink_to(out_path / emoji)

    print(out_path.relative_to(asar_root))