Changeset 15690 for issm/trunk-jpl/src/c/shared/Enum/Synchronize.sh
- Timestamp:
- 08/02/13 13:49:45 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified issm/trunk-jpl/src/c/shared/Enum/Synchronize.sh ¶
r15689 r15690 101 101 END 102 102 #}}} 103 104 # go through the lines of temp 105 ENUM=0; 106 #Add header to pythonenum file{{{ 103 #Build EnumDefinitions.py{{{ 107 104 cat <<END > $ISSM_DIR/src/m/enum/EnumDefinitions.py 108 105 from StringToEnum import StringToEnum … … 110 107 """ 111 108 112 113 114 109 WARNING: DO NOT MODIFY THIS FILE 110 this file has been automatically generated by src/c/shared/Enum/Synchronize.sh 111 Please read src/c/shared/Enum/README for more information 115 112 116 113 """ 117 114 118 115 END 116 #core 117 cat temp | awk '{print "def " $1"(): return StringToEnum(\"" substr($1,1,length($1)-4) "\")[0]"}' >> $ISSM_DIR/src/m/enum/EnumDefinitions.py 119 118 #}}} 119 120 # go through the lines of temp 121 ENUM=0; 120 122 121 123 for NAMEENUM in $(cat temp); do … … 157 159 END 158 160 #}}} 159 #Add case to pythonenum file{{{160 cat <<END >> $ISSM_DIR/src/m/enum/EnumDefinitions.py161 def $(echo $NAMEENUM)():162 """163 $(echo $NAMEENUM | awk {'print toupper($1)'}) - Enum of $(echo $NAME)164 165 WARNING: DO NOT MODIFY THIS FILE166 this file has been automatically generated by src/c/shared/Enum/Synchronize.sh167 Please read src/c/shared/Enum/README for more information168 169 Usage:170 macro=$NAMEENUM()171 """172 173 return StringToEnum('$NAME')[0]174 175 END176 #}}}177 161 178 162 done
Note:
See TracChangeset
for help on using the changeset viewer.