def _get_buildout_ver(directory='.'):
 directory = os.path.abspath(directory)
 buildoutver = 2
 try:
  files = _find_cfgs(directory)
  for f in files:
   with salt.utils.fopen(f) as fic:
    buildout1re = re.compile('^zc\\.buildout\\s*=\\s*1', RE_F)
    dfic = fic.read()
    if (('buildout.dumppick' in dfic) or buildout1re.search(dfic)):
     buildoutver = 1
  bcontent = _get_bootstrap_content(directory)
  if (('--download-base' in bcontent) or ('--setup-source' in bcontent) or ('--distribute' in bcontent)):
   buildoutver = 1
 except (OSError, IOError):
  pass
 return buildoutver

def _get_buildout_ver ( directory = '.' ) : directory = os . path . abspath ( directory ) buildoutver = 2 try : files = _find_cfgs ( directory ) for f in files : with salt . utils . fopen ( f ) as fic : buildout1re = re . compile ( '^zc\\.buildout\\s*=\\s*1' , RE_F ) dfic = fic . read ( ) if ( ( 'buildout.dumppick' in dfic ) or buildout1re . search ( dfic ) ) : buildoutver = 1 bcontent = _get_bootstrap_content ( directory ) if ( ( '--download-base' in bcontent ) or ( '--setup-source' in bcontent ) or ( '--distribute' in bcontent ) ) : buildoutver = 1 except ( OSError , IOError ) : pass return buildoutver
check for buildout versions .