diff --git a/CMakeLists.txt b/CMakeLists.txt index 41675d5..3cb4471 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required (VERSION 2.8.8) project(juci) -set(JUCI_VERSION "1.4.1") +set(JUCI_VERSION "1.4.1.1") set(CPACK_PACKAGE_NAME "jucipp") set(CPACK_PACKAGE_CONTACT "Ole Christian Eidheim ") diff --git a/src/config.cc b/src/config.cc index 737fd31..005bfea 100644 --- a/src/config.cc +++ b/src/config.cc @@ -195,6 +195,7 @@ void Config::read(const boost::property_tree::ptree &cfg) { project.save_on_compile_or_run=cfg.get("project.save_on_compile_or_run"); project.clear_terminal_on_compile=cfg.get("project.clear_terminal_on_compile"); project.ctags_command=cfg.get("project.ctags_command"); + project.python_command=cfg.get("project.python_command"); terminal.history_size=cfg.get("terminal.history_size"); terminal.font=cfg.get("terminal.font"); diff --git a/src/config.h b/src/config.h index 036d29f..738f357 100644 --- a/src/config.h +++ b/src/config.h @@ -47,6 +47,7 @@ public: bool save_on_compile_or_run; bool clear_terminal_on_compile; std::string ctags_command; + std::string python_command; }; class Source { diff --git a/src/files.h b/src/files.h index 5e8210a..be24c6c 100644 --- a/src/files.h +++ b/src/files.h @@ -175,7 +175,8 @@ R"RAW( }, "save_on_compile_or_run": true, "clear_terminal_on_compile": true, - "ctags_command": "ctags" + "ctags_command": "ctags", + "python_command": "PYTHONUNBUFFERED=1 python" }, "documentation_searches": { "clang": { diff --git a/src/project.cc b/src/project.cc index 2ea5003..a21202d 100644 --- a/src/project.cc +++ b/src/project.cc @@ -922,7 +922,7 @@ void Project::Markdown::compile_and_run() { } void Project::Python::compile_and_run() { - auto command="PYTHONUNBUFFERED=1 python "+filesystem::escape_argument(filesystem::get_short_path(Notebook::get().get_current_view()->file_path).string()); + auto command=Config::get().project.python_command+' '+filesystem::escape_argument(filesystem::get_short_path(Notebook::get().get_current_view()->file_path).string()); Terminal::get().print("Running "+command+"\n"); Terminal::get().async_process(command, Notebook::get().get_current_view()->file_path.parent_path(), [command](int exit_status) { Terminal::get().async_print(command+" returned: "+std::to_string(exit_status)+'\n');