Skip to content

Commit

Permalink
Remove qtiplotrc.py startup file. Re #4335.
Browse files Browse the repository at this point in the history
And qtiUtil.py as well.
We hardly used anything in them. The only thing we did was the import
of functions from the qti module into the global namespace. This
will be replaced by proxy methods to prevent crashes if objects
are deleted (see #1037).
  • Loading branch information
RussellTaylor committed Jan 3, 2012
1 parent 1b49f12 commit 87a32ac
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 310 deletions.
25 changes: 11 additions & 14 deletions Code/Mantid/MantidPlot/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -790,19 +790,16 @@ endif( WIN32 )
# Now copy the required python files into the build destination
###########################################################################

set ( PYTHON_INSTALL_FILES qtiplotrc.py qtiUtil.py mantidplotrc.py )
foreach ( PYFILE ${PYTHON_INSTALL_FILES} )
# Command to copy when MantidPlot rebuilds. Does not work if the .py files ONLY were modified!
add_custom_command ( TARGET MantidPlot POST_BUILD
COMMAND ${CMAKE_COMMAND} ARGS -E copy
${CMAKE_CURRENT_SOURCE_DIR}/${PYFILE}
${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}
DEPENDS ${PYFILE}
COMMENT "Copying ${PYFILE}"
)
# Perform a copy at cmake run time
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/${PYFILE} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR} COPYONLY )
endforeach ( PYFILE ${PYTHON_INSTALL_FILES} )
# Command to copy when MantidPlot rebuilds. Does not work if the .py files ONLY were modified!
add_custom_command ( TARGET MantidPlot POST_BUILD
COMMAND ${CMAKE_COMMAND} ARGS -E copy
${CMAKE_CURRENT_SOURCE_DIR}/mantidplotrc.py
${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}
DEPENDS mantidplotrc.py
COMMENT "Copying mantidplotrc.py"
)
# Perform a copy at cmake run time
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/mantidplotrc.py ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR} COPYONLY )

add_custom_command ( TARGET MantidPlot POST_BUILD
COMMAND ${CMAKE_COMMAND} ARGS -E copy_directory
Expand Down Expand Up @@ -872,7 +869,7 @@ endif()
install ( TARGETS MantidPlot RUNTIME DESTINATION ${BIN_DIR}
BUNDLE DESTINATION .
)
install ( FILES ${PYTHON_INSTALL_FILES} DESTINATION ${BIN_DIR} )
install ( FILES mantidplotrc.py DESTINATION ${BIN_DIR} )
install ( DIRECTORY mantidplotpy DESTINATION ${BIN_DIR} )

if ( APPLE )
Expand Down
6 changes: 4 additions & 2 deletions Code/Mantid/MantidPlot/mantidplotpy/mantidplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@
raise ImportError('The "mantidplot" module can only be used from within MantidPlot.')

# Grab a few Mantid things so that we can recognise workspace variables
from MantidFramework import WorkspaceProxy, WorkspaceGroup, MatrixWorkspace, mtd, ProxyObject
from MantidFramework import WorkspaceProxy, WorkspaceGroup, MatrixWorkspace, mtd
import proxies
from PyQt4 import QtCore

from PyQt4 import QtCore, QtGui
from PyQt4.QtCore import Qt

#-------------------------- Wrapped MantidPlot functions -----------------

Expand Down
214 changes: 0 additions & 214 deletions Code/Mantid/MantidPlot/qtiUtil.py

This file was deleted.

78 changes: 0 additions & 78 deletions Code/Mantid/MantidPlot/qtiplotrc.py

This file was deleted.

3 changes: 1 addition & 2 deletions Code/Mantid/MantidPlot/src/PythonScripting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,7 @@ bool PythonScripting::start()
//Get the refresh protection flag
Mantid::Kernel::ConfigService::Instance().getValue("pythonalgorithms.refresh.allowed", refresh_allowed);

if( loadInitFile(mantidbin.absoluteFilePath("qtiplotrc.py")) &&
loadInitFile(mantidbin.absoluteFilePath("mantidplotrc.py")) )
if( loadInitFile(mantidbin.absoluteFilePath("mantidplotrc.py")) )
{
d_initialized = true;
}
Expand Down

0 comments on commit 87a32ac

Please sign in to comment.