Changeset 1352 for CMIP6dreq/manage


Ignore:
Timestamp:
03/04/20 13:04:10 (3 months ago)
Author:
mjuckes
Message:

update to python3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • CMIP6dreq/manage/step1.py

    r1073 r1352  
    1111 
    1212from pkg_resources import parse_version 
    13 import sys, os, glob, string, time 
     13import sys, os, glob, time 
    1414if os.path.isfile( 'step2.sh' ): 
    1515  os.unlink( 'step2.sh' ) 
    1616 
    1717d1 = os.getcwd() 
    18 print d1 
     18print( d1 ) 
    1919sys.path.append('../trunk/dreqPy' ) 
    2020##os.chdir( '../trunk/dreqPy' ) 
     
    2424##import __init__ 
    2525version = packageConfig.__version__ 
    26 print 'version = ',version 
     26print( 'version = ',version ) 
    2727##os.chdir( d1 ) 
    2828 
    2929svnBaseUrl = 'http://proj.badc.rl.ac.uk/svn/exarch/CMIP6dreq' 
    3030 
    31 ii = string.join( open( 'versionConfig.tmpl' ).readlines() ) 
     31ii = ' '.join( open( 'versionConfig.tmpl' ).readlines() ) 
    3232tags = glob.glob( '../tags/*' ) 
    3333 
    34 ##f1 = lambda x: map( int, string.split(x, '.' ) ) 
    3534def f1( vs ): 
    3635  if vs == 'latest': 
    3736    return (0,0) 
    38   bits = string.split(vs, '.' ) 
     37  bits = vs.split( '.' ) 
    3938  estr = 'Version string should be "nn.nn" or "nn.[alpha|beta].nn": %s' % vs 
    4039  assert len(bits) in [2,3,4], estr 
     
    7170thistn = parse_version( version ) 
    7271if len(tags) > 0: 
    73   tn = map( parse_version,  tags ) 
     72  tn = [parse_version(x) for x in tags ] 
    7473  tn.sort() 
    7574  assert thistn > tn[-1], 'Requested tag not greater than last tag: %s' % str(tn[-1]) 
    7675 
    7776oo = open( '../trunk/dreqPy/versionConfig.py', 'w' ) 
    78 for l in string.split( ii % (thistag, thiscomment), '\n' ): 
    79   oo.write( '%s\n' % string.strip(l) ) 
     77for l in '\n'.split( ii % (thistag, thiscomment) ): 
     78  oo.write( '%s\n' % l.strip() ) 
    8079oo.close() 
    8180 
     
    8988svn copy %(svnBaseUrl)s/trunk %(svnBaseUrl)s/tags/%(thistag)s -m "%(thiscomment)s" 
    9089 
    91 ## cd %(svnBaseUrl)s/tags 
     90## cd ../tags 
    9291## svn del latest ; svn ci -m "removed latest" 
    9392#svn copy   %(svnBaseUrl)s/tags/%(thistag)s  %(svnBaseUrl)s/tags/latest  -m "update latest" 
Note: See TracChangeset for help on using the changeset viewer.