feat: Week 1 complete - Linux support + IPC API prep
🎉 Major v2.0 rebuild kickoff - Week 1 accomplished! ## Highlights ### Cross-Platform Support 🌍 - ✅ Linux primary platform (Ubuntu/Debian tested) - ✅ Windows fully supported - ✅ macOS experimental support - ✅ Platform-agnostic path handling (XDG spec) - ✅ Auto-detection of KiCAD installation ### Infrastructure 🏗️ - ✅ GitHub Actions CI/CD pipeline - ✅ Pytest framework with 20+ tests - ✅ Pre-commit hooks (Black, MyPy, ESLint) - ✅ Automated Linux installation script - ✅ Enhanced npm scripts ### IPC API Migration Prep 🚀 - ✅ Comprehensive migration plan (30 pages) - ✅ Backend abstraction layer (800+ lines) - ✅ Factory pattern with auto-detection - ✅ SWIG backward compatibility wrapper - ✅ IPC backend skeleton ready ### Documentation 📚 - ✅ Updated README (Linux installation) - ✅ CONTRIBUTING.md guide - ✅ Linux compatibility audit - ✅ IPC API migration plan - ✅ Session summaries - ✅ Platform-specific config templates ## Files Changed - 27 files created - ~3,000 lines of code/docs - 8 comprehensive documentation pages - 20+ unit tests - 5 abstraction layer modules ## Next Steps - Week 2: IPC API migration (project.py → component.py → routing.py) - Migrate from deprecated SWIG to official IPC API - JLCPCB/Digikey integration prep 🤖 Generated with Claude Code https://claude.com/claude-code Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
121
test/example_skip_usage.py
Normal file
121
test/example_skip_usage.py
Normal file
@@ -0,0 +1,121 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Example script to inspect and document kicad-skip library capabilities
|
||||
"""
|
||||
|
||||
import sys
|
||||
import inspect
|
||||
import os
|
||||
import traceback
|
||||
|
||||
def main():
|
||||
"""Examine the kicad-skip library functionality"""
|
||||
print("=== Examining kicad-skip library ===")
|
||||
|
||||
try:
|
||||
# Import the module
|
||||
print("Importing skip module...")
|
||||
import skip
|
||||
print(f"Skip module path: {skip.__file__}")
|
||||
|
||||
# Display module contents
|
||||
print("\nSkip module contents:")
|
||||
for item_name in dir(skip):
|
||||
if not item_name.startswith('_'):
|
||||
try:
|
||||
item = getattr(skip, item_name)
|
||||
if inspect.isclass(item):
|
||||
print(f" Class: {item_name}")
|
||||
# List methods of the class
|
||||
for method_name in dir(item):
|
||||
if not method_name.startswith('_'):
|
||||
method = getattr(item, method_name)
|
||||
if inspect.ismethod(method) or inspect.isfunction(method):
|
||||
print(f" - Method: {method_name}")
|
||||
elif inspect.isfunction(item):
|
||||
print(f" Function: {item_name}")
|
||||
else:
|
||||
print(f" Other: {item_name} (type: {type(item).__name__})")
|
||||
except Exception as e:
|
||||
print(f" Error examining {item_name}: {e}")
|
||||
|
||||
# Test Schematic class specifically
|
||||
print("\nExamining Schematic class:")
|
||||
if hasattr(skip, 'Schematic'):
|
||||
schematic_class = skip.Schematic
|
||||
print(f"Schematic class: {schematic_class}")
|
||||
|
||||
# Check initialization parameters
|
||||
try:
|
||||
sig = inspect.signature(schematic_class.__init__)
|
||||
print(f"Schematic.__init__ signature: {sig}")
|
||||
|
||||
# List required parameters
|
||||
required_params = [
|
||||
name for name, param in sig.parameters.items()
|
||||
if param.default == inspect.Parameter.empty and name != 'self'
|
||||
]
|
||||
print(f"Required parameters: {required_params}")
|
||||
|
||||
# Display initialization docstring
|
||||
print(f"__init__ docstring: {schematic_class.__init__.__doc__}")
|
||||
except Exception as e:
|
||||
print(f"Error examining Schematic.__init__: {e}")
|
||||
|
||||
# Create a simple test file
|
||||
test_dir = os.path.dirname(__file__)
|
||||
test_file = os.path.join(test_dir, 'test_example.kicad_sch')
|
||||
|
||||
with open(test_file, 'w') as f:
|
||||
f.write("(kicad_sch (version 20230121) (generator \"Test Example\"))\n")
|
||||
|
||||
# Try loading the test file
|
||||
print(f"\nLoading test file {test_file}")
|
||||
try:
|
||||
sch = skip.Schematic(test_file)
|
||||
print("Successfully created Schematic object")
|
||||
|
||||
# Examine the object's attributes and methods
|
||||
print("\nSchematic object attributes:")
|
||||
for attr_name in dir(sch):
|
||||
if not attr_name.startswith('_'):
|
||||
try:
|
||||
attr = getattr(sch, attr_name)
|
||||
if callable(attr):
|
||||
print(f" Method: {attr_name}")
|
||||
else:
|
||||
print(f" Attribute: {attr_name} = {attr}")
|
||||
except Exception as e:
|
||||
print(f" Error examining {attr_name}: {e}")
|
||||
|
||||
# Check for io-related methods
|
||||
print("\nLooking for IO-related methods:")
|
||||
for method_name in ['save', 'write', 'to_file', 'export', 'dump']:
|
||||
print(f" Has '{method_name}' method: {hasattr(sch, method_name)}")
|
||||
|
||||
# Examine the representation of the object
|
||||
print(f"\nStr representation: {str(sch)}")
|
||||
print(f"Repr representation: {repr(sch)}")
|
||||
|
||||
# Clean up
|
||||
os.remove(test_file)
|
||||
except Exception as e:
|
||||
print(f"Error testing Schematic: {e}")
|
||||
traceback.print_exc()
|
||||
|
||||
# Clean up even on error
|
||||
if os.path.exists(test_file):
|
||||
os.remove(test_file)
|
||||
else:
|
||||
print("Schematic class not found in skip module")
|
||||
|
||||
except ImportError as e:
|
||||
print(f"Failed to import skip module: {e}")
|
||||
except Exception as e:
|
||||
print(f"An unexpected error occurred: {e}")
|
||||
traceback.print_exc()
|
||||
|
||||
print("\n=== Examination completed ===")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user