From 8d5403260b72115cfd9f401289dfd0f894e272ea Mon Sep 17 00:00:00 2001 From: jaseg Date: Sat, 29 Apr 2023 11:28:38 +0200 Subject: Fix aperture macro rotation issue and add missing data files --- gerbonara/aperture_macros/parse.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gerbonara/aperture_macros/parse.py') diff --git a/gerbonara/aperture_macros/parse.py b/gerbonara/aperture_macros/parse.py index 72703ae..b8970ff 100644 --- a/gerbonara/aperture_macros/parse.py +++ b/gerbonara/aperture_macros/parse.py @@ -55,9 +55,9 @@ class ApertureMacro: comments: tuple = () def __post_init__(self): - if self.name is None: + if self.name is None or re.match(r'GNX[0-9A-F]{16}', self.name): # We can't use field(default_factory=...) here because that factory doesn't get a reference to the instance. - object.__setattr__(self, 'name', f'gn_{hash(self):x}') + object.__setattr__(self, 'name', f'GNX{hash(self)&0xffffffffffffffff:016X}') @classmethod def parse_macro(cls, name, body, unit): -- cgit