parameters: (work_dir)
return_statement: return ''
docstring: extracts buildid from MAR
docstring_summary: extracts buildid from MAR
docstring_tokens: extracts buildid from MAR
function: def get_buildid(work_dir):
      """ extracts buildid from MAR
      """
      ini = '%s/application.ini' % work_dir
      if not os.path.exists(ini):
          ini = '%s/Contents/Resources/application.ini' % work_dir
          if not os.path.exists(ini):
              print 'WARNING: application.ini not found, cannot find build ID'
              return ''
  
      file = bz2.BZ2File(ini)
      for line in file:
          if line.find('BuildID') == 0:
              return line.strip().split('=')[1]
      print 'WARNING: cannot find build ID in application.ini'
      return ''
function_tokens: def get_buildid ( work_dir ) : ini = '%s/application.ini' % work_dir if not os . path . exists ( ini ) : ini = '%s/Contents/Resources/application.ini' % work_dir if not os . path . exists ( ini ) : print 'WARNING: application.ini not found, cannot find build ID' return '' file = bz2 . BZ2File ( ini ) for line in file : if line . find ( 'BuildID' ) == 0 : return line . strip ( ) . split ( '=' ) [ 1 ] print 'WARNING: cannot find build ID in application.ini' return ''