Index: /issm/trunk-jpl/src/c/EnumDefinitions/Synchronize.sh
===================================================================
--- /issm/trunk-jpl/src/c/EnumDefinitions/Synchronize.sh	(revision 12669)
+++ /issm/trunk-jpl/src/c/EnumDefinitions/Synchronize.sh	(revision 12670)
@@ -2,9 +2,10 @@
 #Synchronize EnumToStringx.cpp and StringToEnumx.cpp and matlab Enums
 
-#Get all lines of EnumDefinitions2.h which hold Enum | remove all comas > put everything in file temp
+#Get all lines of EnumDefinitions2.h which hold Enum | remove all commas > put everything in file temp
 cat EnumDefinitions.h | grep -e "[0-9]Enum," -e "[a-zA-Z]Enum," | grep -v include | sed -e "s/,/ /g" | awk '{print $1}' > temp
 
 #Removed existing files
 rm $ISSM_DIR/src/m/enum/*.m
+rm $ISSM_DIR/src/m/enum/*.py
 rm $ISSM_DIR/src/c/modules/EnumToStringx/EnumToStringx.cpp
 rm $ISSM_DIR/src/c/modules/StringToEnumx/StringToEnumx.cpp
@@ -104,4 +105,16 @@
 # go through the lines of temp
 ENUM=0;
+#Add header to pythonenum file{{{
+cat <<END > $ISSM_DIR/src/m/enum/EnumDefinitions.py
+"""
+
+   WARNING: DO NOT MODIFY THIS FILE
+            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
+            Please read src/c/EnumDefinitions/README for more information
+
+"""
+
+END
+
 for NAMEENUM in $(cat temp); do
 
@@ -143,19 +156,15 @@
 #}}}
 	#Add case to pythonenum file{{{
-	cat <<END > $ISSM_DIR"/src/m/enum/"$(echo $NAMEENUM".py")
-"""
-$(echo $NAMEENUM | awk {'print toupper($1)'}) - Enum of $(echo $NAME)
-
-   WARNING: DO NOT MODIFY THIS FILE
-            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
-            Please read src/c/EnumDefinitions/README for more information
-
-   Usage:
-      macro=$NAMEENUM()
-"""
-
+	cat <<END >> $ISSM_DIR/src/m/enum/EnumDefinitions.py
 def $(echo $NAMEENUM)():
+	"""
+	$(echo $NAMEENUM | awk {'print toupper($1)'}) - Enum of $(echo $NAME)
+
+	   Usage:
+	      macro=$NAMEENUM()
+	"""
 
 	return StringToEnum('$NAME')
+
 END
 #}}}
@@ -180,21 +189,17 @@
 #}}}
 #MaximumNumberOfEnums (python){{{
-cat <<END > $ISSM_DIR/src/m/enum/MaximumNumberOfEnums.py
-"""
-$(echo "MaximumNumberOfEnums" | awk {'print toupper($1)'}) - Enum of MaximumNumberOfEnums
-
-   WARNING: DO NOT MODIFY THIS FILE
-            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
-            Please read src/c/EnumDefinitions/README for more information
-
-   Usage:
-      macro=MaximumNumberOfEnums()
-"""
-
+cat <<END >> $ISSM_DIR/src/m/enum/EnumDefinitions.py
 def MaximumNumberOfEnums():
+	"""
+	$(echo "MaximumNumberOfEnums" | awk {'print toupper($1)'}) - Enum of MaximumNumberOfEnums
+
+	   Usage:
+	      macro=MaximumNumberOfEnums()
+	"""
 
 	return $(cat EnumDefinitions.h | grep -e "[0-9]Enum" -e "[a-zA-Z]Enum" | grep -v include \
 		| awk '{ printf "%s %s\n", NR-1, $0 }' \
 		| grep "MaximumNumberOfEnums" | awk '{print $1}')
+
 END
 #}}}
