Ignore:
Timestamp:
08/02/13 13:49:45 (12 years ago)
Author:
Mathieu Morlighem
Message:

NEW: EnumDefinitions.py is now made at once, dividing the time of sync by a factor of 2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified issm/trunk-jpl/src/c/shared/Enum/Synchronize.sh

    r15689 r15690  
    101101END
    102102#}}}
    103 
    104 # go through the lines of temp
    105 ENUM=0;
    106 #Add header to pythonenum file{{{
     103#Build EnumDefinitions.py{{{
    107104cat <<END > $ISSM_DIR/src/m/enum/EnumDefinitions.py
    108105from StringToEnum import StringToEnum
     
    110107"""
    111108
    112    WARNING: DO NOT MODIFY THIS FILE
    113             this file has been automatically generated by src/c/shared/Enum/Synchronize.sh
    114             Please read src/c/shared/Enum/README for more information
     109WARNING: DO NOT MODIFY THIS FILE
     110this file has been automatically generated by src/c/shared/Enum/Synchronize.sh
     111Please read src/c/shared/Enum/README for more information
    115112
    116113"""
    117114
    118115END
     116#core
     117cat temp |  awk '{print "def " $1"(): return StringToEnum(\"" substr($1,1,length($1)-4) "\")[0]"}' >> $ISSM_DIR/src/m/enum/EnumDefinitions.py
    119118#}}}
     119
     120# go through the lines of temp
     121ENUM=0;
    120122
    121123for NAMEENUM in $(cat temp); do
     
    157159END
    158160#}}}
    159         #Add case to pythonenum file{{{
    160         cat <<END >> $ISSM_DIR/src/m/enum/EnumDefinitions.py
    161 def $(echo $NAMEENUM)():
    162         """
    163         $(echo $NAMEENUM | awk {'print toupper($1)'}) - Enum of $(echo $NAME)
    164 
    165         WARNING: DO NOT MODIFY THIS FILE
    166                                 this file has been automatically generated by src/c/shared/Enum/Synchronize.sh
    167                                 Please read src/c/shared/Enum/README for more information
    168 
    169            Usage:
    170               macro=$NAMEENUM()
    171         """
    172 
    173         return StringToEnum('$NAME')[0]
    174 
    175 END
    176 #}}}
    177161
    178162done
Note: See TracChangeset for help on using the changeset viewer.