Defines a class used to identify aperture objects created by parser.
ApertureID
Bases: str
, GerberCode
Aperture ID wrapper.
Source code in src\pygerber\gerberx3\tokenizer\aperture_id.py
| class ApertureID(str, GerberCode):
"""Aperture ID wrapper."""
__slots__ = ()
@classmethod
def __get_pydantic_core_schema__(
cls,
source_type: Any,
handler: GetCoreSchemaHandler,
) -> CoreSchema:
"""Generate the pydantic-core schema."""
return core_schema.no_info_after_validator_function(cls, handler(str))
def get_gerber_code(
self,
indent: str = "", # noqa: ARG002
endline: str = "\n", # noqa: ARG002
) -> str:
"""Get gerber code represented by this token."""
return f"{self}"
|
__get_pydantic_core_schema__
classmethod
__get_pydantic_core_schema__(
source_type: Any, handler: GetCoreSchemaHandler
) -> CoreSchema
Generate the pydantic-core schema.
Source code in src\pygerber\gerberx3\tokenizer\aperture_id.py
| @classmethod
def __get_pydantic_core_schema__(
cls,
source_type: Any,
handler: GetCoreSchemaHandler,
) -> CoreSchema:
"""Generate the pydantic-core schema."""
return core_schema.no_info_after_validator_function(cls, handler(str))
|
get_gerber_code
get_gerber_code(
indent: str = "", endline: str = "\n"
) -> str
Get gerber code represented by this token.
Source code in src\pygerber\gerberx3\tokenizer\aperture_id.py
| def get_gerber_code(
self,
indent: str = "", # noqa: ARG002
endline: str = "\n", # noqa: ARG002
) -> str:
"""Get gerber code represented by this token."""
return f"{self}"
|