Skip to content
Snippets Groups Projects
Commit 8dbd7d9c authored by Gigg, Martyn Anthony's avatar Gigg, Martyn Anthony
Browse files

Define a welcome message for Mantid.

Updated Python scripting startup to be slightly friendlier to this. 
Mantid part first so that the build goes in the right order.
Re #1791
parent 0dc8455b
No related branches found
No related tags found
No related merge requests found
...@@ -454,7 +454,6 @@ addFileV('MantidProperties','Mantid.pro','Mantid.properties','Mantid.properties' ...@@ -454,7 +454,6 @@ addFileV('MantidProperties','Mantid.pro','Mantid.properties','Mantid.properties'
MantidScript = addFileV('MantidScript','MScr.bat','MantidScript.bat','../Mantid/PythonAPI/MantidScript.bat',MantidDlls) MantidScript = addFileV('MantidScript','MScr.bat','MantidScript.bat','../Mantid/PythonAPI/MantidScript.bat',MantidDlls)
addTo(MantidScript,'Shortcut',{'Id':'startmenuMantidScript','Directory':'ProgramMenuDir','Name':'Script','LongName':'Mantid Script','WorkingDirectory':'MantidBin'}) addTo(MantidScript,'Shortcut',{'Id':'startmenuMantidScript','Directory':'ProgramMenuDir','Name':'Script','LongName':'Mantid Script','WorkingDirectory':'MantidBin'})
addFileV('MantidStartup','MStart.py','MantidStartup.py','../Mantid/PythonAPI/MantidStartup.py',MantidDlls) addFileV('MantidStartup','MStart.py','MantidStartup.py','../Mantid/PythonAPI/MantidStartup.py',MantidDlls)
addFileV('MantidHeader','MHeader.py','MantidHeader.py','../Mantid/PythonAPI/MantidHeader.py',MantidDlls)
addFileV('MantidPythonAPI_pyd','MPAPI.pyd','MantidPythonAPI.pyd',MANTIDRELEASE + 'MantidPythonAPI.pyd',MantidDlls) addFileV('MantidPythonAPI_pyd','MPAPI.pyd','MantidPythonAPI.pyd',MANTIDRELEASE + 'MantidPythonAPI.pyd',MantidDlls)
addFileV('MantidAPI','MAPI.dll','MantidAPI.dll',MANTIDRELEASE + 'MantidAPI.dll',MantidDlls) addFileV('MantidAPI','MAPI.dll','MantidAPI.dll',MANTIDRELEASE + 'MantidAPI.dll',MantidDlls)
addFileV('MantidGeometry','MGeo.dll','MantidGeometry.dll',MANTIDRELEASE + 'MantidGeometry.dll',MantidDlls) addFileV('MantidGeometry','MGeo.dll','MantidGeometry.dll',MANTIDRELEASE + 'MantidGeometry.dll',MantidDlls)
......
...@@ -204,6 +204,7 @@ ...@@ -204,6 +204,7 @@
<ClCompile Include="src\LogParser.cpp" /> <ClCompile Include="src\LogParser.cpp" />
<ClCompile Include="src\MandatoryValidator.cpp" /> <ClCompile Include="src\MandatoryValidator.cpp" />
<ClCompile Include="src\MaskedProperty.cpp" /> <ClCompile Include="src\MaskedProperty.cpp" />
<ClCompile Include="src\NeutronAtom.cpp" />
<ClCompile Include="src\Property.cpp" /> <ClCompile Include="src\Property.cpp" />
<ClCompile Include="src\PropertyHistory.cpp" /> <ClCompile Include="src\PropertyHistory.cpp" />
<ClCompile Include="src\PropertyManager.cpp" /> <ClCompile Include="src\PropertyManager.cpp" />
...@@ -231,6 +232,7 @@ ...@@ -231,6 +232,7 @@
<ClInclude Include="inc\mantidkernel\facilityinfo.h" /> <ClInclude Include="inc\mantidkernel\facilityinfo.h" />
<ClInclude Include="inc\mantidkernel\instrumentinfo.h" /> <ClInclude Include="inc\mantidkernel\instrumentinfo.h" />
<ClInclude Include="inc\MantidKernel\LogParser.h" /> <ClInclude Include="inc\MantidKernel\LogParser.h" />
<ClInclude Include="inc\MantidKernel\NeutronAtom.h" />
<ClInclude Include="inc\MantidKernel\TimeSplitter.h" /> <ClInclude Include="inc\MantidKernel\TimeSplitter.h" />
<ClInclude Include="test\ArrayPropertyTest.h" /> <ClInclude Include="test\ArrayPropertyTest.h" />
<ClInclude Include="inc\MantidKernel\BoundedValidator.h" /> <ClInclude Include="inc\MantidKernel\BoundedValidator.h" />
......
...@@ -138,6 +138,9 @@ ...@@ -138,6 +138,9 @@
<ClCompile Include="src\LogParser.cpp"> <ClCompile Include="src\LogParser.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="src\NeutronAtom.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="inc\MantidKernel\ArrayProperty.h"> <ClInclude Include="inc\MantidKernel\ArrayProperty.h">
...@@ -368,6 +371,9 @@ ...@@ -368,6 +371,9 @@
<ClInclude Include="inc\MantidKernel\LogParser.h"> <ClInclude Include="inc\MantidKernel\LogParser.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="inc\MantidKernel\NeutronAtom.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="test\TestChannel.hh"> <None Include="test\TestChannel.hh">
......
...@@ -30,6 +30,12 @@ namespace Poco ...@@ -30,6 +30,12 @@ namespace Poco
namespace Mantid namespace Mantid
{ {
/**
* Returns the welcome message for Mantid. This is echoed to stdout by the
* ConfigService
*/
static std::string welcomeMessage();
namespace Kernel namespace Kernel
{ {
//---------------------------------------------------------------------- //----------------------------------------------------------------------
...@@ -105,9 +111,7 @@ namespace Mantid ...@@ -105,9 +111,7 @@ namespace Mantid
std::string m_value; ///< The new value for the property std::string m_value; ///< The new value for the property
std::string m_prev; ///< The previous value for the property std::string m_prev; ///< The previous value for the property
}; };
/// Wipe out the current configuration and load a new one /// Wipe out the current configuration and load a new one
void updateConfig(const std::string& filename, const bool append=false, const bool update_caches=true); void updateConfig(const std::string& filename, const bool append=false, const bool update_caches=true);
/// Save the configuration to the user file /// Save the configuration to the user file
...@@ -122,19 +126,28 @@ namespace Mantid ...@@ -122,19 +126,28 @@ namespace Mantid
/// Return the user properties filename /// Return the user properties filename
std::string getUserFilename() const; std::string getUserFilename() const;
// Searches for the given environment variable and returns it as a string /** @name Host information */
//@{
/// Searches for the given environment variable and returns it as a string
std::string getEnvironment(const std::string& keyName); std::string getEnvironment(const std::string& keyName);
/// Returns the OS name
// Getters for properties of the host system
std::string getOSName(); std::string getOSName();
/// Returns the computer name
std::string getComputerName(); std::string getComputerName();
/// Returns the architecture
std::string getOSArchitecture(); std::string getOSArchitecture();
/// Returns the OS version
std::string getOSVersion(); std::string getOSVersion();
/// Returns the current directory
std::string getCurrentDir(); std::string getCurrentDir();
/// Returns the system's temp directory
std::string getTempDir(); std::string getTempDir();
//@}
/// Returns the directory where the framework libraries lie
std::string getBaseDir() const; std::string getBaseDir() const;
/// Returns a directory to use as a default output directory
std::string getOutputDir() const; std::string getOutputDir() const;
/// Get the list of search paths /// Get the list of search paths
const std::vector<std::string>& getDataSearchDirs() const; const std::vector<std::string>& getDataSearchDirs() const;
/// Gets the instrument geometry filename /// Gets the instrument geometry filename
......
...@@ -31,6 +31,14 @@ ...@@ -31,6 +31,14 @@
namespace Mantid namespace Mantid
{ {
/**
* Returns the welcome message for Mantid. This is echoed to stdout by the ConfigService.
*/
std::string welcomeMessage()
{
return "Welcome to Mantid - Manipulation and Analysis Toolkit for Instrument Data";
}
namespace Kernel namespace Kernel
{ {
...@@ -178,6 +186,7 @@ ConfigServiceImpl::ConfigServiceImpl() : ...@@ -178,6 +186,7 @@ ConfigServiceImpl::ConfigServiceImpl() :
g_log.debug() << "ConfigService created." << std::endl; g_log.debug() << "ConfigService created." << std::endl;
g_log.debug() << "Configured base directory of application as " << getBaseDir() << std::endl; g_log.debug() << "Configured base directory of application as " << getBaseDir() << std::endl;
std::cout << "\n" << Mantid::welcomeMessage() << "\n" << std::endl;
g_log.information() << "This is Mantid Version " << MANTID_VERSION << std::endl; g_log.information() << "This is Mantid Version " << MANTID_VERSION << std::endl;
} }
......
##########################################################
# #
# A wrapper module to handle creating the Mantid Python #
# framework. #
# #
##########################################################
from MantidFramework import *
mtd.initialise(False)
from MantidHeader import * from MantidFramework import *
mtd.initialise()
print "\n==== Mantid Scripting Interface ==== \n" print "\n==== Mantid Scripting Interface ==== \n"
print "Mantid Framework Manager 'mantid' ready.\n" print "Mantid Framework Manager 'mantid' ready.\n"
mantidHelp() print "Type mtdHelp() for a list of available algorithms"
\ No newline at end of file \ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment