From 1c9726ca024a27709c29c4b5d3efb7a33d50d4ed Mon Sep 17 00:00:00 2001
From: Dilawar Singh <dilawars@ncbs.res.in>
Date: Sun, 20 Nov 2016 14:30:30 +0530
Subject: [PATCH] Fixed, python2 incompatible print function use.

---
 CMakeLists.txt                                 | 18 +++++++++++-------
 moose-core/VERSION                             |  2 +-
 .../paper-2015/Fig6_NetMultiscale/Fig6BCDE.py  |  3 +--
 3 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index f3b7d54d..78f590d6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -41,21 +41,22 @@ add_custom_command( OUTPUT ${OUTPUT_MOOSEBIN}
     )
 
 # Now build moose-gui and moose-examples.
+# Make sure each script is compilable. Else report an error.
 add_custom_target( gui ALL 
-    COMMAND ${CMAKE_COMMAND} -E copy_directory 
-        ${MOOSE_GUI_DIR} ${MOOSE_GUI_INSTALL_DIR} 
+    COMMAND ${CMAKE_COMMAND} -E copy_directory ${MOOSE_GUI_DIR} ${MOOSE_GUI_INSTALL_DIR} 
+    COMMAND ${PYTHON_EXECUTABLE} -m compileall -q ${MOOSE_GUI_INSTALL_DIR}
     COMMENT "Building moose-gui"
     VERBATIM
     )
 
-# Now copy moose-examples.
-add_custom_command( TARGET gui POST_BUILD
-    COMAMND ${CMAKE_COMMAND} -E copy_directory 
-        ${MOOSE_EXAMPLE_DIR} ${MOOSE_EXAMPLE_INSTALL_DIR}
+add_custom_target( examples ALL 
+    COMMAND ${CMAKE_COMMAND} -E copy_directory ${MOOSE_EXAMPLE_DIR} ${MOOSE_EXAMPLE_INSTALL_DIR}
+    COMMAND ${PYTHON_EXECUTABLE} -m compileall -q ${MOOSE_EXAMPLE_INSTALL_DIR}
     VERBATIM
     )
 
-add_dependencies(moose moose-core gui)
+add_dependencies(moose moose-core gui examples)
+add_dependencies(examples  gui)
 
 
 ## moose-gui
@@ -65,11 +66,13 @@ set(MOOSE_GUI_DIR ${CMAKE_SOURCE_DIR}/moose-gui)
 install(DIRECTORY ${PYMOOSE_INSTALL_DIR}/
     DESTINATION ${CMAKE_INSTALL_PREFIX}
     PATTERN ".git" EXCLUDE
+    PATTERN "*.pyc" EXCLUDE
     )
 
 install(DIRECTORY ${MOOSE_GUI_INSTALL_DIR}/
     DESTINATION lib/moose/gui
     PATTERN ".git*" EXCLUDE
+    PATTERN "*.pyc" EXCLUDE
     )
 
 install(DIRECTORY ${MOOSE_EXAMPLE_DIR}/
@@ -77,6 +80,7 @@ install(DIRECTORY ${MOOSE_EXAMPLE_DIR}/
     PATTERN ".git*" EXCLUDE 
     PATTERN "_travis*" EXCLUDE
     PATTERN ".travis*" EXCLUDE
+    PATTERN "*.pyc" EXCLUDE
     )
 
 configure_file( ${CMAKE_SOURCE_DIR}/cmake/moose.in ${CMAKE_BINARY_DIR}/moose )
diff --git a/moose-core/VERSION b/moose-core/VERSION
index 50e47c89..11e8934c 100644
--- a/moose-core/VERSION
+++ b/moose-core/VERSION
@@ -1 +1 @@
-3.1.1
\ No newline at end of file
+3.1.1-71-g67012a1
\ No newline at end of file
diff --git a/moose-examples/paper-2015/Fig6_NetMultiscale/Fig6BCDE.py b/moose-examples/paper-2015/Fig6_NetMultiscale/Fig6BCDE.py
index 8211d73d..82a9ece3 100644
--- a/moose-examples/paper-2015/Fig6_NetMultiscale/Fig6BCDE.py
+++ b/moose-examples/paper-2015/Fig6_NetMultiscale/Fig6BCDE.py
@@ -1,3 +1,4 @@
+from __future__ import print_function
 
 #/**********************************************************************
 #** This program is part of 'MOOSE', the
@@ -33,11 +34,9 @@ from PyQt4 import Qt, QtCore, QtGui
 from numpy import random as nprand
 from moose.neuroml.NeuroML import NeuroML
 import sys
-sys.path.append( "/home/bhalla/moose/trunk/Demos/util" )
 import rdesigneur as rd
 import moogli
 cellname = "./cells_channels/CA1_nochans.morph.xml"
-#cellname = "./ca1_minimal.p"
 fname = "fig6bcde"
 
 #############################################
-- 
GitLab