From 73c3fd6fbe654f0fbae55a8cbc089468dd57783c Mon Sep 17 00:00:00 2001
From: Mathieu Doucet <doucetm@ornl.gov>
Date: Tue, 28 Sep 2010 19:32:46 +0000
Subject: [PATCH] Long overdue one-liner that will make life in pythonland much
 easier (MANTIDPATH environment variable). Re #1594

---
 Code/Mantid/Kernel/src/ConfigService.cpp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/Code/Mantid/Kernel/src/ConfigService.cpp b/Code/Mantid/Kernel/src/ConfigService.cpp
index ad05e1f7913..a891b8003a5 100644
--- a/Code/Mantid/Kernel/src/ConfigService.cpp
+++ b/Code/Mantid/Kernel/src/ConfigService.cpp
@@ -21,6 +21,7 @@
 #include "Poco/DOM/Element.h"
 #include "Poco/DOM/NodeList.h"
 #include "Poco/Notification.h"
+#include "Poco/Environment.h"
 
 #include <fstream>
 #include <sstream>
@@ -139,7 +140,10 @@ ConfigServiceImpl::ConfigServiceImpl() :
   if (callingApplication.find("python") != std::string::npos || callingApplication.find("matlab")
       != std::string::npos)
   {
-    m_strBaseDir = Poco::Path::current();
+    if (Poco::Environment::has("MANTIDPATH"))
+       m_strBaseDir = Poco::Environment::get("MANTIDPATH");
+    else
+      m_strBaseDir = Poco::Path::current();
   }
   else
   {
-- 
GitLab