<s> import os <EOL> import sys <EOL> import arcpy <EOL> import Base <EOL> class UserCode : <EOL> def sample00 ( self , data ) : <EOL> base = Base . Base ( ) <EOL> xmlDOM = data [ '<STR_LIT>' ] <EOL> command_used = base . getXMLNodeValue ( xmlDOM , '<STR_LIT>' ) <EOL> workspace = data [ '<STR_LIT>' ] <EOL> md = data [ '<STR_LIT>' ] <EOL> log = data [ '<STR_LIT>' ] <EOL> log . Message ( '<STR_LIT>' % ( workspace , md ) , <NUM_LIT:0> ) <EOL> return True <EOL> def sample01 ( self , data ) : <EOL> log = data [ '<STR_LIT>' ] <EOL> log . Message ( '<STR_LIT>' , <NUM_LIT:0> ) <EOL> return True <EOL> def customCV ( self , data ) : <EOL> workspace = data [ '<STR_LIT>' ] <EOL> md = data [ '<STR_LIT>' ] <EOL> ds = os . path . join ( workspace , md ) <EOL> ds_cursor = arcpy . UpdateCursor ( ds ) <EOL> if ( ds_cursor != None ) : <EOL> print ( '<STR_LIT>' ) <EOL> row = ds_cursor . next ( ) <EOL> while ( row != None ) : <EOL> row . setValue ( '<STR_LIT>' , <NUM_LIT:0> ) <EOL> row . setValue ( '<STR_LIT>' , <NUM_LIT> ) <EOL> WRS_Path = row . getValue ( '<STR_LIT>' ) <EOL> WRS_Row = row . getValue ( '<STR_LIT>' ) <EOL> if ( WRS_Path != None and <EOL> WRS_Row != None ) : <EOL> PR = ( WRS_Path * <NUM_LIT:1000> ) + WRS_Row <EOL> row . setValue ( '<STR_LIT>' , PR ) <EOL> AcquisitionData = row . getValue ( '<STR_LIT>' ) <EOL> if ( AcquisitionData != None ) : <EOL> AcquisitionData = str ( AcquisitionData ) . replace ( '<STR_LIT:->' , '<STR_LIT:/>' ) <EOL> day = int ( AcquisitionData . split ( ) [ <NUM_LIT:0> ] . split ( '<STR_LIT:/>' ) [ <NUM_LIT:1> ] ) <EOL> row . setValue ( '<STR_LIT>' , day ) <EOL> grp_name = row . getValue ( '<STR_LIT>' ) <EOL> if ( grp_name != None ) : <EOL> CMAX_INDEX = <NUM_LIT:16> <EOL> if ( len ( grp_name ) >= CMAX_INDEX ) : <EOL> row . setValue ( '<STR_LIT>' , int ( grp_name [ <NUM_LIT> : CMAX_INDEX ] ) ) <EOL> row . setValue ( '<STR_LIT:Name>' , grp_name . split ( '<STR_LIT:_>' ) [ <NUM_LIT:0> ] + '<STR_LIT:_>' + row . getValue ( '<STR_LIT>' ) ) <EOL> ds_cursor . updateRow ( row ) <EOL> row = ds_cursor . next ( ) <EOL> del ds_cursor <EOL> return True </s>
