MCPcopy Create free account
hub / github.com/FastLED/FastLED / demo_convenience_function

Function demo_convenience_function

ci/examples/fingerprint_cache_demo.py:201–219  ·  view source on GitHub ↗

Demonstrate the convenience has_changed function.

()

Source from the content-addressed store, hash-verified

199
200
201def demo_convenience_function() -> None:
202 """Demonstrate the convenience has_changed function."""
203 print("\n=== Convenience Function Demo ===")
204
205 with tempfile.TemporaryDirectory() as temp_dir:
206 temp_path = Path(temp_dir)
207 cache_file = temp_path / "convenience_cache.json"
208
209 # Create test file
210 test_file = temp_path / "test.h"
211 with open(test_file, "w") as f:
212 f.write("#pragma once\n#define API_VERSION 1")
213
214 baseline_time = time.time() - 1800 # 30 minutes ago
215
216 # Use convenience function
217 changed = has_changed(test_file, baseline_time, cache_file)
218 print(f"Convenience function result: {changed}")
219 print(f"Cache file created: {cache_file.exists()}")
220
221
222if __name__ == "__main__":

Callers 1

Calls 4

timeMethod · 0.80
has_changedFunction · 0.70
printFunction · 0.50
writeMethod · 0.45

Tested by

no test coverage detected