MCPcopy Create free account
hub / github.com/El-EnderJ/NeoCalculator / loadScript

Method loadScript

src/apps/PythonApp.cpp:673–689  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

671}
672
673bool PythonApp::loadScript(const char* filename, char* buffer, int bufSize) {
674#ifdef ARDUINO
675 char path[64];
676 snprintf(path, sizeof(path), "/py/%s", filename);
677 File f = LittleFS.open(path, "r");
678 if (!f) return false;
679 int len = f.readBytes(buffer, bufSize - 1);
680 buffer[len] = '\0';
681 f.close();
682 return true;
683#else
684 (void)filename;
685 strncpy(buffer, "# hello.py\nfor i in range(5):\n print(i)\n", bufSize - 1);
686 buffer[bufSize - 1] = '\0';
687 return true;
688#endif
689}
690
691void PythonApp::ensureDefaultScripts() {
692#ifdef ARDUINO

Callers

nothing calls this directly

Calls 2

openMethod · 0.80
closeMethod · 0.80

Tested by

no test coverage detected