parameters: (component)
docstring: Extracts the current version number from the VERSION.txt
      file and increments it appropriately for the release type
      requested.
docstring_summary: Extracts the current version number from the VERSION.txt
      file and increments it appropriately for the release type
      requested.
docstring_tokens: Extracts the current version number from the VERSION . txt file and increments it appropriately for the release type requested .
function: def get_comp_versions (component):
      """ Extracts the current version number from the VERSION.txt
      file and increments it appropriately for the release type
      requested."""
      vprint ("Detecting current version for " + component)
  
      regex = re.compile (r"version " + version_restr)
      major = component + "_major"
      minor = component + "_minor"
      micro = component + "_micro"
  
  
      version = (None, None, None)
      with open (doc_root + "/ACE_TAO/" + component + "/VERSION.txt") as version_file:
          for line in version_file:
              match = regex.search (line)
              if match is not None:
                  version = match.groups(default=0)
  
                  vprint ("Detected version %s.%s.%s" % version)
  
                  comp_versions[major] = int (version[0])
                  comp_versions[minor] = int (version[1])
                  comp_versions[micro] = int (version[2])
  
                  break
  
              print ("FATAL ERROR: Unable to locate current version for " + component)
              raise Exception
  
      # Also store the current release (old from now)
      old_comp_versions[major] = comp_versions[major]
      old_comp_versions[minor] = comp_versions[minor]
      old_comp_versions[micro] = comp_versions[micro]
  
      if opts.update:
          if opts.release_type == ReleaseType.major:
              comp_versions[major] += 1
              comp_versions[minor] = 0
              comp_versions[micro] = 0
          elif opts.release_type == ReleaseType.minor:
              comp_versions[minor] += 1
              comp_versions[micro] = 0
          elif opts.release_type == ReleaseType.micro:
              comp_versions[micro] += 1
  
      def make_version (versions, joiner):
          return joiner.join ([
            str (versions[component + '_' + x]) for x in ReleaseType.__members__.keys ()
          ])
  
      comp_versions [component + "_version"] = make_version (comp_versions, '.')
      comp_versions [component + "_version_"] = make_version (comp_versions, '_')
  
      comp_versions [component + "_code"] = \
          (comp_versions[major] << 16) + \
          (comp_versions[minor] << 8) + \
          comp_versions[micro]
  
      old_comp_versions [component + "_version"] = make_version (old_comp_versions, '.')
      old_comp_versions [component + "_version_"] = make_version (old_comp_versions, '_')
  
      if opts.update:
        vprint ("Updating from version %s to version %s" %
                    (old_comp_versions [component + "_version"], comp_versions [component + "_version"]))
      else:
        vprint ("Found version %s" %
                    (comp_versions [component + "_version"]))
function_tokens: def get_comp_versions ( component ) : vprint ( "Detecting current version for " + component ) regex = re . compile ( r"version " + version_restr ) major = component + "_major" minor = component + "_minor" micro = component + "_micro" version = ( None , None , None ) with open ( doc_root + "/ACE_TAO/" + component + "/VERSION.txt" ) as version_file : for line in version_file : match = regex . search ( line ) if match is not None : version = match . groups ( default = 0 ) vprint ( "Detected version %s.%s.%s" % version ) comp_versions [ major ] = int ( version [ 0 ] ) comp_versions [ minor ] = int ( version [ 1 ] ) comp_versions [ micro ] = int ( version [ 2 ] ) break print ( "FATAL ERROR: Unable to locate current version for " + component ) raise Exception # Also store the current release (old from now) old_comp_versions [ major ] = comp_versions [ major ] old_comp_versions [ minor ] = comp_versions [ minor ] old_comp_versions [ micro ] = comp_versions [ micro ] if opts . update : if opts . release_type == ReleaseType . major : comp_versions [ major ] += 1 comp_versions [ minor ] = 0 comp_versions [ micro ] = 0 elif opts . release_type == ReleaseType . minor : comp_versions [ minor ] += 1 comp_versions [ micro ] = 0 elif opts . release_type == ReleaseType . micro : comp_versions [ micro ] += 1 def make_version ( versions , joiner ) : return joiner . join ( [ str ( versions [ component + '_' + x ] ) for x in ReleaseType . __members__ . keys ( ) ] ) comp_versions [ component + "_version" ] = make_version ( comp_versions , '.' ) comp_versions [ component + "_version_" ] = make_version ( comp_versions , '_' ) comp_versions [ component + "_code" ] = ( comp_versions [ major ] << 16 ) + ( comp_versions [ minor ] << 8 ) + comp_versions [ micro ] old_comp_versions [ component + "_version" ] = make_version ( old_comp_versions , '.' ) old_comp_versions [ component + "_version_" ] = make_version ( old_comp_versions , '_' ) if opts . update : vprint ( "Updating from version %s to version %s" % ( old_comp_versions [ component + "_version" ] , comp_versions [ component + "_version" ] ) ) else : vprint ( "Found version %s" % ( comp_versions [ component + "_version" ] ) )