Changes between Version 3 and Version 4 of DX/DXCodeReuse


Ignore:
Timestamp:
02/02/07 12:53:21 (12 years ago)
Author:
astephen
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DX/DXCodeReuse

    v3 v4  
    1515}}} 
    1616 
    17 Also allows you to add a unit of time to an existing DateTime object such as: 
     17Also allows you to add a unit of time to an existing !DateTime object such as: 
    1818 
    1919{{{ 
     
    5252(year, month, day, hour, minute, second) = getDateTimeComponents(dateTimeString) 
    5353}}} 
    54 # Takes in a time string in standard DateTime format and returns the items in it. 
     54...takes in a time string in standard !DateTime format and returns the items in it. 
    5555 
    5656{{{ 
    57571|0 = keyPatternMatch(dct, pattern, mode="string match") 
    5858}}} 
    59 # Returns 1 if one or more keys in the dictionary 'dct' match the pattern provided using string.find(). Returns 0 otherwise. 
     59 
     60...returns 1 if one or more keys in the dictionary 'dct' match the pattern provided using string.find(). Returns 0 otherwise. 
    6061  
     62{{{ 
    6163inRangeArray = getValuesInRange(start, end, array) 
    62 # Takes a start and end value and returns the values in the array that are between them. If not in range and are the same value then returns [start]. 
     64}}} 
    6365 
     66...takes a start and end value and returns the values in the array that are between them. If not in range and are the same value then returns [start]. 
     67 
     68{{{ 
    6469sortedKeyList = getSortedKeysLike(dct, pattern, mode="string match") 
    65 # Returns a list of all keys in the dictionary 'dct' that do a string match on 'pattern'. 
     70}}} 
    6671 
     72...returns a list of all keys in the dictionary 'dct' that do a string match on 'pattern'. 
     73 
     74{{{ 
    6775dictSubset = getDictSubsetMatching(dct, pattern, mode="string match") 
    68 # Returns a dictionary of all items in input dictionary 'dct' where keys match 'pattern'. 
     76}}} 
     77 
     78...returns a dictionary of all items in input dictionary 'dct' where keys match 'pattern'. 
    6979     
     80{{{ 
    7081deletedCount = deleteDictSubsetMatching(dct, pattern, mode="string match") 
    71 # Deletes any items in the dictionary subset matched when calling getDictSubsetMatching above. Returns the number of items deleted. 
    72      
     82}}} 
     83 
     84...deletes any items in the dictionary subset matched when calling getDictSubsetMatching above. Returns the number of items deleted. 
     85  
     86{{{    
    7387timeString = convertDateTimeStringToYYYYMMDDHH(timeString) 
    74 # Takes in a long CF-compliant time string and returns a shorter YYYYMMDDHH string. 
     88}}} 
    7589 
     90...takes in a long CF-compliant time string and returns a shorter YYYYMMDDHH string. 
     91 
     92{{{ 
    7693cleanedObject = deUnicodeObject(obj) 
    77 #  Returns the object identical except unicode strings are all converted to normal strings. 
     94}}} 
     95...returns the object identical except unicode strings are all converted to normal strings. 
    7896 
     97{{{ 
    79980|1 = compareCdmsAxes(ax1, ax2) 
    80 # Takes 2 cdms axis objects returning 1 if they are essentially the same and 0 if not. 
     99}}} 
    81100 
     101...takes 2 cdms axis objects returning 1 if they are essentially the same and 0 if not. 
     102 
     103{{{ 
    821040|1 = compareGrids(grid1, grid2): 
    83 # Takes 2 cdms grid objects returning 1 if they are essentially the same and 0 if not. 
     105}}} 
    84106 
     107...takes 2 cdms grid objects returning 1 if they are essentially the same and 0 if not. 
     108 
     109{{{ 
    85110(newValue, newValue, rtMessage) = nudgeSingleValuesToAxisValues(value, axisValues, axisType) 
    86 # Takes a value and checks if it is in the axisValues array. If not, it nudges the value to the nearest neighbour in axis. It returns the new value twice along with a message describing the change. 
     111}}} 
    87112 
     113...takes a value and checks if it is in the axisValues array. If not, it nudges the value to the nearest neighbour in axis. It returns the new value twice along with a message describing the change. 
     114 
     115{{{ 
    88116makeDirsAndPerms(basedir, dirs, permissions, owner, verbose="no") 
    89 # A function for making directories recursively and setting permissions/ownership. 
     117}}} 
     118...a function for making directories recursively and setting permissions/ownership. 
    90119 
    91 class RedirectStdout: 
    92 # RedirectStdout class - used to direct standard output away from the screen in CGI scripts. 
     120{{{ 
     121class !RedirectStdout: 
     122}}} 
     123 
     124...used to direct standard output away from the screen in CGI scripts.