# Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: daniel+launchpad@landau.fi-20150413211917-\ # 7mmygya9sanjbxeh # target_branch: http://bazaar.launchpad.net/~referencer-\ # devs/referencer/trunk/ # testament_sha1: a98d5f9dfb2f2216ab690e0ffd1cb5d71f4fa34e # timestamp: 2015-04-14 00:20:02 +0300 # base_revision_id: launchpad@shiyee.dk-20140227102949-\ # 21mgbdqo3yerdwuz # # Begin patch === modified file 'src/PluginManager.C' --- src/PluginManager.C 2012-10-29 00:14:38 +0000 +++ src/PluginManager.C 2015-04-13 21:19:17 +0000 @@ -6,12 +6,16 @@ #include +#ifdef ENABLE_PYTHON #include "Python.h" +#endif #include "BibData.h" #include "Document.h" #include "Preferences.h" +#ifdef ENABLE_PYTHON #include "PythonDocument.h" +#endif #include "Transfer.h" #include "Utility.h" @@ -25,6 +29,7 @@ static int numargs=0; +#ifdef ENABLE_PYTHON /* Return the number of arguments of the application command line */ static PyObject* referencer_download(PyObject *self, PyObject *args) @@ -153,14 +158,16 @@ "Translate a string"}, {NULL, NULL, 0, NULL} }; - +#endif PluginManager::PluginManager () { +#ifdef ENABLE_PYTHON PyObject *module = Py_InitModule ("referencer", ReferencerMethods); PyType_Ready (&t_referencer_document); PyObject_SetAttrString (module, "document", (PyObject*)&t_referencer_document); +#endif progressCallback_ = NULL; } @@ -171,6 +178,7 @@ void PluginManager::scan (std::string const &pluginDir) { +#ifdef ENABLE_PYTHON DIR *dir = opendir (pluginDir.c_str()); if (!dir) { // Fail silently, allow the caller to call this @@ -214,11 +222,13 @@ } } closedir (dir); +#endif } Glib::ustring PluginManager::findDataFile (Glib::ustring const file) { +#ifdef ENABLE_PYTHON std::vector::iterator it = pythonPaths_.begin (); std::vector::iterator const end = pythonPaths_.end (); for (; it != end; ++it) { @@ -235,6 +245,7 @@ if (uri->query_exists ()) return filename; } +#endif return Glib::ustring (); } @@ -243,11 +254,13 @@ { PluginList retval; +#ifdef ENABLE_PYTHON std::list::iterator it = pythonPlugins_.begin(); std::list::iterator end = pythonPlugins_.end(); for (; it != end; ++it) { retval.push_back (&(*it)); } +#endif retval.push_back (&crossref_); retval.push_back (&arxiv_); @@ -259,6 +272,7 @@ PluginManager::PluginList PluginManager::getEnabledPlugins () { std::list retval; +#ifdef ENABLE_PYTHON std::list::iterator it = pythonPlugins_.begin(); std::list::iterator end = pythonPlugins_.end(); @@ -266,7 +280,8 @@ if (it->isEnabled()) retval.push_back (&(*it)); } - +#endif + if (arxiv_.isEnabled ()) retval.push_back (&arxiv_); === modified file 'src/PluginManager.h' --- src/PluginManager.h 2012-10-29 00:14:38 +0000 +++ src/PluginManager.h 2015-04-13 21:19:17 +0000 @@ -5,10 +5,14 @@ #include #include +#ifdef ENABLE_PYTHON #include +#endif #include "Plugin.h" +#ifdef ENABLE_PYTHON #include "PythonPlugin.h" +#endif #include "CrossRefPlugin.h" #include "ArxivPlugin.h" @@ -47,8 +51,10 @@ /* Python module search locations */ std::vector pythonPaths_; +#ifdef ENABLE_PYTHON /* Loaded python modules */ std::list pythonPlugins_; +#endif /* Builtin plugins */ CrossRefPlugin crossref_; === modified file 'src/Preferences.C' --- src/Preferences.C 2011-03-21 10:27:19 +0000 +++ src/Preferences.C 2015-04-13 21:19:17 +0000 @@ -137,7 +137,6 @@ aboutButton_->signal_clicked().connect ( sigc::mem_fun (*this, &Preferences::onPluginAbout)); - // Iterate over all plugins std::list plugins = _global_plugins->getPlugins(); std::list::iterator pit = plugins.begin(); === modified file 'src/PythonDocument.C' --- src/PythonDocument.C 2014-01-26 20:49:45 +0000 +++ src/PythonDocument.C 2015-04-13 21:19:17 +0000 @@ -1,6 +1,7 @@ #include +#ifdef ENABLE_PYTHON #include #include @@ -217,3 +218,5 @@ PyType_GenericNew, _PyObject_Del }; + +#endif === modified file 'src/PythonPlugin.C' --- src/PythonPlugin.C 2012-10-30 06:24:27 +0000 +++ src/PythonPlugin.C 2015-04-13 21:19:17 +0000 @@ -1,4 +1,4 @@ - +#ifdef ENABLE_PYTHON #include @@ -651,3 +651,5 @@ } } +#endif + === modified file 'src/main.C' --- src/main.C 2014-01-13 17:35:16 +0000 +++ src/main.C 2015-04-13 21:19:17 +0000 @@ -14,8 +14,10 @@ #include #include +#ifdef ENABLE_PYTHON #include #include +#endif #include "config.h" @@ -47,12 +49,14 @@ Gio::init (); +#ifdef ENABLE_PYTHON Glib::ustring pythonPath = ""; /* Pick up existing python path */ if (getenv("PYTHONPATH")) { pythonPath += ":"; pythonPath += getenv("PYTHONPATH"); } +#endif /* Locate user plugins */ Glib::ustring homePlugins; @@ -64,6 +68,7 @@ /* Systemwide */ Glib::ustring installedPlugins = PLUGINDIR; +#ifdef ENABLE_PYTHON /* Order is important, defines precedence */ pythonPath += ":"; pythonPath += localPlugins; @@ -76,6 +81,7 @@ DEBUG (String::ucompose ("setting pythonPath to %1", pythonPath)); setenv ("PYTHONPATH", pythonPath.c_str(), 1); Py_Initialize (); +#endif _global_plugins = new PluginManager (); _global_plugins->scan("./plugins"); @@ -98,8 +104,10 @@ } delete _global_prefs; +#ifdef ENABLE_PYTHON delete _global_plugins; Py_Finalize (); +#endif return 0; } # Begin bundle IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWfCRJtgABITfgAAQWGv/935H xCC////wYAc99DbUVO2MwrA5UAFAJKRHpE8k8mMUmnqPUG01GgB6mQaNAlTKaZMKno9U/KnqA0NA AAAABzAJgBMAAJgACYAAlNCBExDTUappiaB6g0ADJo9QHMAmAEwAAmAAJgACKSATCaaamCYTTSZT NNSep6NT1M09Kep9xon33269e/zNcSEJITs7u73QOIQl+/rPxTQWbLryydV22kglTKeaNdMkd8Ch 9pDNSWaZq+HSHVTDla0zte9BOurxCxbFcRlSluw33scmEzJAkAJDJCTafmzAcstM8vhgzNXKpr2d Wqqa0GlCVVhWeIonybBM3d0r2eYxFEE1fZBXLEQqorUnKj0KUezKYxiJJWSurocX9eDAfxr54Cl3 cNrxb2C+mJbmAvmlzomRW2sExisE6MWn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