Skip to content
This repository has been archived by the owner on Oct 2, 2020. It is now read-only.

schlib.py - Components don't remove successfully #315

Open
rs-development opened this issue Nov 14, 2019 · 1 comment
Open

schlib.py - Components don't remove successfully #315

rs-development opened this issue Nov 14, 2019 · 1 comment

Comments

@rs-development
Copy link

I tried to create an empty library from a existing one be removing all components. I did this in a loop:

for c in lib_new.components: 
     print(lib_new.removeComponent(c.name))

But i had to run the loop multiple times to remove all components, untill no components are in the list and getComponentCount equals zero.

If the library is saved with new_lib.save() the components are still there.

Any idea whats going wrong?

@rs-development
Copy link
Author

It seems to be, that the new_lib.header has to be cleared. But then the first 2 file lines are missing after saving:

EESchema-LIBRARY Version 2.4
#encoding utf-8

Those 2 lines are not generated if the header is cleared and the library is than saved. Shouldn't the schlib.py handle those things internally?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant