(file) Return to localize.py CVS log (file) (dir) Up to [Development] / JSOC

Diff for /JSOC/localize.py between version 1.8 and 1.10

version 1.8, 2013/11/13 19:38:37 version 1.10, 2013/11/15 21:45:34
Line 42  PERL_FXNS_A = """sub new
Line 42  PERL_FXNS_A = """sub new
     };     };
  
     bless($self, $clname);     bless($self, $clname);
     $self->{_paramsH} = $self->initialize();      $self->{_paramsH} = {};
       $self->initialize();
  
     return $self;     return $self;
 } }
Line 259  def processParam(cfgfile, line, regexpQu
Line 260  def processParam(cfgfile, line, regexpQu
                 # constants (the names of which are the parameter names)                 # constants (the names of which are the parameter names)
                 # we can refer to those in the init section. The key variable holds the                 # we can refer to those in the init section. The key variable holds the
                 # name of the constant.                 # name of the constant.
                 perlInitSection.extend(list('\n  $self->{_paramsH}->{' + key + '} = ' + "'" + val + "';"))                  perlInitSection.extend(list("\n  $self->{_paramsH}->{'" + key + "'} = " + key + ';'))
             else:             else:
                 # No quote qualifier                 # No quote qualifier
                 raise Exception('missingQuoteQual', key)                 raise Exception('missingQuoteQual', key)
Line 395  def parseConfig(fin, keymap, addenda, de
Line 396  def parseConfig(fin, keymap, addenda, de
                     section = newSection                     section = newSection
  
                 if section == 'make':                 if section == 'make':
   
                     # There are some blocks of lines in the __MAKE__ section that must be copied ver batim to the output make file.                     # There are some blocks of lines in the __MAKE__ section that must be copied ver batim to the output make file.
                     # The blocks are defined by _CUST_/_ENDCUST_ tags.                     # The blocks are defined by _CUST_/_ENDCUST_ tags.
                     matchobj = regexpCustMkBeg.match(line)                     matchobj = regexpCustMkBeg.match(line)
Line 416  def parseConfig(fin, keymap, addenda, de
Line 418  def parseConfig(fin, keymap, addenda, de
                     ppRet = processParam(iscfg, line, regexpQuote, regexp, keymap, defs, cDefs, mDefsGen, mDefsMake, perlConstSection, perlInitSection, platDict, machDict, section)                     ppRet = processParam(iscfg, line, regexpQuote, regexp, keymap, defs, cDefs, mDefsGen, mDefsMake, perlConstSection, perlInitSection, platDict, machDict, section)
  
                     if ppRet:                     if ppRet:
                         break;                          break
                 elif section == 'projcfg':                 elif section == 'projcfg':
                     # Copy the line ver batim to the projCfg list (configure)                     # Copy the line ver batim to the projCfg list (configure)
                     for line in fin:                     for line in fin:
Line 512  def parseConfig(fin, keymap, addenda, de
Line 514  def parseConfig(fin, keymap, addenda, de
             for var in machDict[mach]:             for var in machDict[mach]:
                 mDefsMake.extend(list('\n' + var + ' = ' + machDict[mach][var]))                 mDefsMake.extend(list('\n' + var + ' = ' + machDict[mach][var]))
             mDefsMake.extend(list('\nendif\n'))             mDefsMake.extend(list('\nendif\n'))
   
     return rv     return rv
  
 def getMgrUIDLine(defs, uidParam): def getMgrUIDLine(defs, uidParam):
Line 651  def configureComps(defs, mDefs):
Line 652  def configureComps(defs, mDefs):
             mDefs.extend(list('\nFCOMPILER = gfortran'))             mDefs.extend(list('\nFCOMPILER = gfortran'))
  
         # Environment overrides. These get written, regardless of the disposition of auto-configuration.         # Environment overrides. These get written, regardless of the disposition of auto-configuration.
         mDefs.extend(list('\nifneq ($(JSOC_COMPILER,))\n  COMPILER = $(JSOC_COMPILER)\nendif'))          mDefs.extend(list('\nifneq ($(JSOC_COMPILER),)\n  COMPILER = $(JSOC_COMPILER)\nendif'))
         mDefs.extend(list('\nifneq ($(JSOC_FCOMPILER,))\n  FCOMPILER = $(JSOC_FCOMPILER)\nendif'))          mDefs.extend(list('\nifneq ($(JSOC_FCOMPILER),)\n  FCOMPILER = $(JSOC_FCOMPILER)\nendif'))
  
     return rv     return rv
  
Line 734  def writeProjFiles(pCfile, pMfile, pRfil
Line 735  def writeProjFiles(pCfile, pMfile, pRfil
         rv = bool(1)         rv = bool(1)
  
     if not rv:     if not rv:
           if os.path.exists(pCfile):
         try:         try:
             os.chmod(pCfile, stat.S_IRWXU | stat.S_IRGRP | stat.S_IROTH)             os.chmod(pCfile, stat.S_IRWXU | stat.S_IRGRP | stat.S_IROTH)
         except OSError as exc:         except OSError as exc:
                   type, value, traceback = sys.exc_info()
                   print('Unable to chmod file ' + "'" + value.filename + "'.", file=sys.stderr)
             print(exc.strerror, file=sys.stderr)             print(exc.strerror, file=sys.stderr)
             rv = bool(1)             rv = bool(1)
  
Line 782  def configureNet(cfgfile, cfile, mfile,
Line 786  def configureNet(cfgfile, cfile, mfile,
                 rv = getMgrUIDLine(defs, uidParam)                 rv = getMgrUIDLine(defs, uidParam)
                 if rv == bool(0):                 if rv == bool(0):
                     rv = parseConfig(None, keymap, uidParam, defs, cDefs, mDefsGen, None, projCfg, projMkRules, projRules, projTarget, perlConstSection, perlInitSection)                     rv = parseConfig(None, keymap, uidParam, defs, cDefs, mDefsGen, None, projCfg, projMkRules, projRules, projTarget, perlConstSection, perlInitSection)
   
             # Configure the compiler-selection make variables.             # Configure the compiler-selection make variables.
             if not rv:             if not rv:
                 rv = configureComps(defs, mDefsComps)                 rv = configureComps(defs, mDefsComps)
Line 790  def configureNet(cfgfile, cfile, mfile,
Line 793  def configureNet(cfgfile, cfile, mfile,
             # Write out the parameter files.             # Write out the parameter files.
             if not rv:             if not rv:
                 rv = writeParamsFiles(base, cfile, mfile, pfile, cDefs, mDefsGen, mDefsMake, mDefsComps, perlConstSection, perlInitSection)                 rv = writeParamsFiles(base, cfile, mfile, pfile, cDefs, mDefsGen, mDefsMake, mDefsComps, perlConstSection, perlInitSection)
   
             # Write out the project-specific make files (make_basic.mk, Rules.mk, and target.mk).             # Write out the project-specific make files (make_basic.mk, Rules.mk, and target.mk).
             if not rv:             if not rv:
                 rv = writeProjFiles(pCfile, pMfile, pRfile, pTfile, projCfg, projMkRules, projRules, projTarget)                 rv = writeProjFiles(pCfile, pMfile, pRfile, pTfile, projCfg, projMkRules, projRules, projTarget)
   
     except IOError as exc:     except IOError as exc:
         print(exc.strerror, file=sys.stderr)         print(exc.strerror, file=sys.stderr)
         print('Unable to read configuration file ' + cfgfile + '.', file=sys.stderr)         print('Unable to read configuration file ' + cfgfile + '.', file=sys.stderr)


Legend:
Removed from v.1.8  
changed lines
  Added in v.1.10

Karen Tian
Powered by
ViewCVS 0.9.4