def env_vars_from_file(filename):
 if (not os.path.exists(filename)):
  raise ConfigurationError((u"Couldn't find env file: %s" % filename))
 elif (not os.path.isfile(filename)):
  raise ConfigurationError((u'%s is not a file.' % filename))
 env = {}
 for line in codecs.open(filename, u'r', u'utf-8'):
  line = line.strip()
  if (line and (not line.startswith(u'#'))):
   (k, v) = split_env(line)
   env[k] = v
 return env

def env_vars_from_file ( filename ) : if ( not os . path . exists ( filename ) ) : raise ConfigurationError ( ( u"Couldn't find env file: %s" % filename ) ) elif ( not os . path . isfile ( filename ) ) : raise ConfigurationError ( ( u'%s is not a file.' % filename ) ) env = { } for line in codecs . open ( filename , u'r' , u'utf-8' ) : line = line . strip ( ) if ( line and ( not line . startswith ( u'#' ) ) ) : ( k , v ) = split_env ( line ) env [ k ] = v return env
read in a line delimited file of environment variables .