| 163 | } |
| 164 | |
| 165 | bool EmbeddedPython::connect(const int port) { |
| 166 | try { |
| 167 | exec(R"( |
| 168 | XSTUDIO = Connection( |
| 169 | debug=False |
| 170 | ) |
| 171 | )"); |
| 172 | exec( |
| 173 | R"( |
| 174 | XSTUDIO.connect_remote( |
| 175 | "127.0.0.1", |
| 176 | )" + std::to_string(port) + |
| 177 | R"( |
| 178 | ) |
| 179 | )"); |
| 180 | |
| 181 | exec("XSTUDIO.load_python_plugins()"); |
| 182 | |
| 183 | } catch (const std::exception &err) { |
| 184 | spdlog::warn("{} Failed to init API : {} ", __PRETTY_FUNCTION__, err.what()); |
| 185 | return false; |
| 186 | } |
| 187 | return true; |
| 188 | } |
| 189 | |
| 190 | bool EmbeddedPython::connect(caf::actor actor) { |
| 191 | try { |