From 0bc31b2043f52a8a78940edc4116b8707c4f1a63 Mon Sep 17 00:00:00 2001 From: Eugene Mikhantyev Date: Sat, 18 Apr 2026 15:14:53 +0100 Subject: [PATCH] refactor: remove dead list_library_symbols stub The placeholder static method on LibraryManager (library_schematic.py) returned [] and had no dispatch entry or caller. The real tool of the same name lives in library_symbol.py. Co-Authored-By: Claude Opus 4.7 --- python/commands/library_schematic.py | 31 ---------------------------- 1 file changed, 31 deletions(-) diff --git a/python/commands/library_schematic.py b/python/commands/library_schematic.py index d057884..be96118 100644 --- a/python/commands/library_schematic.py +++ b/python/commands/library_schematic.py @@ -46,32 +46,10 @@ class LibraryManager: # Return both full paths and library names return {"paths": libraries, "names": library_names} - @staticmethod - def list_library_symbols(library_path: str) -> List[Any]: - """List all symbols in a library""" - try: - # kicad-skip doesn't provide a direct way to simply list symbols in a library - # without loading each one. We might need to implement this using KiCAD's Python API - # directly, or by using a different approach. - # For now, this is a placeholder implementation. - - # A potential approach would be to load the library file using KiCAD's Python API - # or by parsing the library file format. - # KiCAD symbol libraries are .kicad_sym files which are S-expression format - logger.warning( - f"Attempted to list symbols in library {library_path}. This requires advanced implementation." - ) - return [] - except Exception as e: - logger.error(f"Error listing symbols in library {library_path}: {e}") - return [] - @staticmethod def get_symbol_details(library_path: str, symbol_name: str) -> Dict[str, Any]: """Get detailed information about a symbol""" try: - # Similar to list_library_symbols, this might require a more direct approach - # using KiCAD's Python API or by parsing the symbol library. logger.warning( f"Attempted to get details for symbol {symbol_name} in library {library_path}. This requires advanced implementation." ) @@ -143,15 +121,6 @@ if __name__ == "__main__": # Example Usage (for testing) # List available libraries libraries = LibraryManager.list_available_libraries() - if libraries["paths"]: - first_lib = libraries["paths"][0] - lib_name = libraries["names"][0] - print(f"Testing with first library: {lib_name} ({first_lib})") - - # List symbols in the first library - symbols = LibraryManager.list_library_symbols(first_lib) - # This will report that it requires advanced implementation - # Get default symbol for a component type resistor_sym = LibraryManager.get_default_symbol_for_component_type("resistor") print(f"Default symbol for resistor: {resistor_sym['library']}/{resistor_sym['symbol']}")