Skip to content
Snippets Groups Projects
Forked from pycodegen / pystencils-sfg
58 commits behind, 10 commits ahead of the upstream repository.
  • Frederik Hennig's avatar
    5c595075
    More frontend updates · 5c595075
    Frederik Hennig authored
     - Add `Ref` type
     - Allow multi-arg `init` in constructor builder
     - Change `CustomGenerator` to take a composer instead of a context.
     - Allow a class to have multiple methods with the same name.
    5c595075
    History
    More frontend updates
    Frederik Hennig authored
     - Add `Ref` type
     - Allow multi-arg `init` in constructor builder
     - Change `CustomGenerator` to take a composer instead of a context.
     - Allow a class to have multiple methods with the same name.
custom.py 373 B
from __future__ import annotations
from abc import ABC, abstractmethod
from typing import TYPE_CHECKING

if TYPE_CHECKING:
    from .composer import SfgComposer


class CustomGenerator(ABC):
    """Abstract base class for custom code generators that may be passed to
    `SfgComposer.generate`."""

    @abstractmethod
    def generate(self, sfg: SfgComposer) -> None: ...