diff options
author | jaseg <git@jaseg.de> | 2023-04-29 11:28:38 +0200 |
---|---|---|
committer | jaseg <git@jaseg.de> | 2023-04-29 11:28:38 +0200 |
commit | 8d5403260b72115cfd9f401289dfd0f894e272ea (patch) | |
tree | 0f7ac51c4072477018fec6f8d153d00365735f34 /gerbonara/aperture_macros/parse.py | |
parent | 778e81974580d910eac5e3f977acf79744d3e085 (diff) | |
download | gerbonara-8d5403260b72115cfd9f401289dfd0f894e272ea.tar.gz gerbonara-8d5403260b72115cfd9f401289dfd0f894e272ea.tar.bz2 gerbonara-8d5403260b72115cfd9f401289dfd0f894e272ea.zip |
Fix aperture macro rotation issue and add missing data files
Diffstat (limited to 'gerbonara/aperture_macros/parse.py')
-rw-r--r-- | gerbonara/aperture_macros/parse.py | 4 |
1 files changed, 2 insertions, 2 deletions
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): |