MitjaNemec / ReplicateLayout

GNU General Public License v2.0
90 stars 12 forks source link

Fix settings parsing, ReplicateLayoutDialog.on_ok(), Replicator.replicate_layout() #28

Closed Mike-Morin closed 1 year ago

Mike-Morin commented 1 year ago

I noticed the ReplicateLayout plugin v1.2.4 wasn't working on a fresh install of KiCad 6.09-1.fc36 (Fedora 36), installed via KiCad Plugin and Content Manager. Using Python 3.10.8.

Clicking "Ok" on the ReplicateLayout dialog after selecting the anchor footprint did not give any response or do the desired replication. The following error was produced, visible when running KiCad in terminal:

Traceback (most recent call last): File "/home/XXXX/.local/share/kicad/6.0/3rdparty/plugins/com_github_MitjaNemec_ReplicateLayout/action_replicate_layout.py", line 165, in on_ok settings = Settings(rep_tracks=self.chkbox_tracks.GetValue(), rep_zones=self.chkbox_zones.GetValue(), TypeError: Settings.__new__() got an unexpected keyword argument 'containing'

I see there was some refactoring happening with Settings in 85d4320858d1b5c87bf888f8dc08ad3593896d0b and it looks like ReplicateLayoutDialog.on_ok() and Replicator.replicate_layout() reference the old Settings.

This PR updates those functions to reflect the new Settings and fixes the error on my machine.

MitjaNemec commented 1 year ago

Thanks for spotting this and (partially) solving this. I'll obviously have add more tests to catch all the cases