From ca126a4d6c9f5642c1dae9427cd05645f52e7a90 Mon Sep 17 00:00:00 2001 From: tedjk Date: Mon, 11 May 2015 14:08:25 +0200 Subject: [PATCH] made it work --- juci/CMakeLists.txt | 4 ++-- juci/api.cc | 11 +---------- juci/api.h | 4 +--- juci/api_ext.cc | 5 +---- juci/plugins.py | 6 ++++-- 5 files changed, 9 insertions(+), 21 deletions(-) diff --git a/juci/CMakeLists.txt b/juci/CMakeLists.txt index 625d06a..53b86cb 100644 --- a/juci/CMakeLists.txt +++ b/juci/CMakeLists.txt @@ -131,8 +131,8 @@ link_directories( ${LIBCLANG_LIBRARY_DIRS} ) #module: -set_target_properties(${module} PROPERTIES PREFIX "" - LIBRARY_OUTPUT_DIRECTORY "/usr/lib/python2.7/dist-packages/") +set_target_properties(${module} PROPERTIES PREFIX "") +# LIBRARY_OUTPUT_DIRECTORY "/usr/lib/python2.7/dist-packages/") target_link_libraries(${module} ${PYTHON_LIBRARIES} ${Boost_LIBRARIES}) #executable: target_link_libraries(${project_name} ${LIVCLANG_LIBRARIES} ${LCL_LIBRARIES} ${GTKMM_LIBRARIES} ${Boost_LIBRARIES} ${PYTHON_LIBRARIES}) diff --git a/juci/api.cc b/juci/api.cc index ae7534a..4c74620 100644 --- a/juci/api.cc +++ b/juci/api.cc @@ -107,7 +107,7 @@ void libjuci::ReplaceWord(const std::string word) { } void libjuci::ReplaceLine(const std::string line) { - std::cout << "unimplemented function: 'libjuci::ReplaceLine()' called" + std::cout << "unimplemented: " << __func__ << " called" << std::endl; } std::string libjuci::GetWord() { @@ -201,16 +201,7 @@ void libjuci::IterToWordEnd(Gtk::TextIter &iter) { } Glib::RefPtr libjuci::BufferFromNotebook() { - // finding focused view - // int i = 0; - // while (!PluginApi::notebook_->source_vec_.at(i)->view().has_focus()) { - // i++; - // while(!PluginApi::notebook_->CurrentTextView().has_focus()) { - // i++; - // } return Glib::RefPtr(PluginApi::notebook_ - // ->source_vec_.at(i) - // ->view().get_buffer()); ->CurrentTextView().get_buffer()); } diff --git a/juci/api.h b/juci/api.h index 46f3f98..4534487 100644 --- a/juci/api.h +++ b/juci/api.h @@ -25,7 +25,6 @@ public: const std::string menu_func_name, const std::string plugin_path, const std::string menu_keybinding); - // text-buffer functions static void ReplaceWord(const std::string word); static void ReplaceLine(const std::string line); protected: @@ -64,11 +63,10 @@ namespace libjuci { namespace bp = boost::python; bp::api::object OpenPythonScript(const std::string path, bp::api::object python_name_space); - void LoadPlugin(const std::string& plugin_name); void LoadPluginFunction(const std::string &function_name, const std::string &plugin_path); void InitPlugin(const std::string& plugin_path); -} // libjuci +} // namespace libjuci #endif // JUCI_API_H_ diff --git a/juci/api_ext.cc b/juci/api_ext.cc index e04bc11..9b8b1ba 100644 --- a/juci/api_ext.cc +++ b/juci/api_ext.cc @@ -12,7 +12,4 @@ BOOST_PYTHON_MODULE(juci_to_python_api) { def("replaceLine", &libjuci::ReplaceLine); def("replaceWord", &libjuci::ReplaceWord); def("getWord", &libjuci::GetWord); - - - //something more - }// module::juci_to_python_api + } // module::juci_to_python_api diff --git a/juci/plugins.py b/juci/plugins.py index 70bbf5b..f8faf6e 100644 --- a/juci/plugins.py +++ b/juci/plugins.py @@ -1,9 +1,11 @@ #!/usr/bin/python #plugin handler -import juci_to_python_api as juci, os, glob +import sys, os, glob +cwd = os.getcwd() +sys.path.append(cwd) +import juci_to_python_api as juci def loadplugins(): - cwd = os.getcwd() plugin_files = glob.glob(cwd+"/plugins/*.py") for current_file in plugin_files: juci.initPlugin(current_file)