Changeset 12670
- Timestamp:
- 07/20/12 12:07:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/EnumDefinitions/Synchronize.sh
r12669 r12670 2 2 #Synchronize EnumToStringx.cpp and StringToEnumx.cpp and matlab Enums 3 3 4 #Get all lines of EnumDefinitions2.h which hold Enum | remove all com as > put everything in file temp4 #Get all lines of EnumDefinitions2.h which hold Enum | remove all commas > put everything in file temp 5 5 cat EnumDefinitions.h | grep -e "[0-9]Enum," -e "[a-zA-Z]Enum," | grep -v include | sed -e "s/,/ /g" | awk '{print $1}' > temp 6 6 7 7 #Removed existing files 8 8 rm $ISSM_DIR/src/m/enum/*.m 9 rm $ISSM_DIR/src/m/enum/*.py 9 10 rm $ISSM_DIR/src/c/modules/EnumToStringx/EnumToStringx.cpp 10 11 rm $ISSM_DIR/src/c/modules/StringToEnumx/StringToEnumx.cpp … … 104 105 # go through the lines of temp 105 106 ENUM=0; 107 #Add header to pythonenum file{{{ 108 cat <<END > $ISSM_DIR/src/m/enum/EnumDefinitions.py 109 """ 110 111 WARNING: DO NOT MODIFY THIS FILE 112 this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh 113 Please read src/c/EnumDefinitions/README for more information 114 115 """ 116 117 END 118 106 119 for NAMEENUM in $(cat temp); do 107 120 … … 143 156 #}}} 144 157 #Add case to pythonenum file{{{ 145 cat <<END > $ISSM_DIR"/src/m/enum/"$(echo $NAMEENUM".py") 146 """ 147 $(echo $NAMEENUM | awk {'print toupper($1)'}) - Enum of $(echo $NAME) 148 149 WARNING: DO NOT MODIFY THIS FILE 150 this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh 151 Please read src/c/EnumDefinitions/README for more information 152 153 Usage: 154 macro=$NAMEENUM() 155 """ 156 158 cat <<END >> $ISSM_DIR/src/m/enum/EnumDefinitions.py 157 159 def $(echo $NAMEENUM)(): 160 """ 161 $(echo $NAMEENUM | awk {'print toupper($1)'}) - Enum of $(echo $NAME) 162 163 Usage: 164 macro=$NAMEENUM() 165 """ 158 166 159 167 return StringToEnum('$NAME') 168 160 169 END 161 170 #}}} … … 180 189 #}}} 181 190 #MaximumNumberOfEnums (python){{{ 182 cat <<END > $ISSM_DIR/src/m/enum/MaximumNumberOfEnums.py 183 """ 184 $(echo "MaximumNumberOfEnums" | awk {'print toupper($1)'}) - Enum of MaximumNumberOfEnums 185 186 WARNING: DO NOT MODIFY THIS FILE 187 this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh 188 Please read src/c/EnumDefinitions/README for more information 189 190 Usage: 191 macro=MaximumNumberOfEnums() 192 """ 193 191 cat <<END >> $ISSM_DIR/src/m/enum/EnumDefinitions.py 194 192 def MaximumNumberOfEnums(): 193 """ 194 $(echo "MaximumNumberOfEnums" | awk {'print toupper($1)'}) - Enum of MaximumNumberOfEnums 195 196 Usage: 197 macro=MaximumNumberOfEnums() 198 """ 195 199 196 200 return $(cat EnumDefinitions.h | grep -e "[0-9]Enum" -e "[a-zA-Z]Enum" | grep -v include \ 197 201 | awk '{ printf "%s %s\n", NR-1, $0 }' \ 198 202 | grep "MaximumNumberOfEnums" | awk '{print $1}') 203 199 204 END 200 205 #}}}
Note:
See TracChangeset
for help on using the changeset viewer.