INNER CODE UNIT · Python

__init__

WMAL/kodachios · Kodachi-OS-10-stable/open/dock/lib/kodachi_direct.py:383

    def __init__(self, path=None, linux_executables=LINUX_EXECUTABLES):
        self.path, self.document, operations, cells = _read_contract(path)
        self.operations = {}
        operation_ids = set()
        for operation in operations:
            if not isinstance(operation, dict):
                raise DirectContractError("command-window operation is not an object")
            category = operation.get("category")
            label = operation.get("label")
            if not isinstance(category, str) or not isinstance(label, str):
                raise DirectContractError("command-window operation has no identity")
            key = (category, label)
            if key in self.operations:
                raise DirectContractError(f"duplicate command-window operation {key!r}")
            operation_id = operation.get("id")
            if (not isinstance(operation_id, str)
                    or not operation_id.startswith("gtk.operation.")):
                raise DirectContractError(

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…