def get_envs(yaml_dict):
 env = get_yaml_entry(yaml_dict, 'env')
 if (env is None):
  return ''
 if isinstance(env, basestring):
  return (env + '\n')
 if isinstance(env, (list, tuple)):
  return (env[0] + '\n')
 (globals, matrix) = [get_yaml_entry(env, name) for name in ('global', 'matrix')]
 if hasattr(matrix, 'keys'):
  raise TravisError('Oops, envs too complicated')
 lines = []
 if (not (globals is None)):
  if (matrix is None):
   raise TravisError('global section needs matrix section')
  lines += globals
 if (not (matrix is None)):
  lines.append(matrix[0])
 return ('\n'.join(lines) + '\n')

def get_envs ( yaml_dict ) : env = get_yaml_entry ( yaml_dict , 'env' ) if ( env is None ) : return '' if isinstance ( env , basestring ) : return ( env + '\n' ) if isinstance ( env , ( list , tuple ) ) : return ( env [ 0 ] + '\n' ) ( globals , matrix ) = [ get_yaml_entry ( env , name ) for name in ( 'global' , 'matrix' ) ] if hasattr ( matrix , 'keys' ) : raise TravisError ( 'Oops, envs too complicated' ) lines = [ ] if ( not ( globals is None ) ) : if ( matrix is None ) : raise TravisError ( 'global section needs matrix section' ) lines += globals if ( not ( matrix is None ) ) : lines . append ( matrix [ 0 ] ) return ( '\n' . join ( lines ) + '\n' )
get first env combination from travis yaml dict parameters yaml_dict : dict dict or subdict from parsing .