This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Convert text clippings to .txt files.""" | |
import os | |
import re | |
import subprocess | |
from pathlib import Path | |
import plistlib | |
DEREZ_OUTPUT_RE = re.compile(r"\t\$\"([A-F0-9 ]+)\"\s+/\* (.+?) \*/") | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Functions to make things immutable.""" | |
from collections import OrderedDict | |
from collections.abc import Hashable | |
from typing import Any | |
from immutabledict import immutabledict | |
from pydantic import BaseModel | |
def freeze_data(obj: Any) -> Any: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def resolve_name(obj: Any, name: str, default: Any = None) -> Any: # NOQA: C901 | |
""" | |
Get a key or attr ``name`` from obj or default value. | |
Copied and modified from Django Template variable resolutions | |
Resolution methods: | |
- Mapping key lookup | |
- Attribute lookup |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ci: | |
autofix_prs: false | |
repos: | |
- repo: https://github.com/astral-sh/ruff-pre-commit | |
rev: 'v0.1.6' | |
hooks: | |
- id: ruff | |
args: [--fix, --exit-non-zero-on-fix] | |
exclude: test.* | |
- repo: https://github.com/psf/black |
OlderNewer