def read_json_file(path, kind=None):
 kind = (('%s ' % str(kind)) if kind else '')
 if (not os.path.exists(path)):
  raise ConfigurationError(("Can not find %sfile '%s'" % (kind, path)))
 try:
  f = compat.open_unicode(path)
 except IOError:
  raise ConfigurationError(("Can not open %sfile '%s'" % (kind, path)))
 try:
  content = json.load(f)
 except ValueError as e:
  raise SyntaxError(('Syntax error in %sfile %s: %s' % (kind, path, str(e))))
 finally:
  f.close()
 return content

def read_json_file ( path , kind = None ) : kind = ( ( '%s ' % str ( kind ) ) if kind else '' ) if ( not os . path . exists ( path ) ) : raise ConfigurationError ( ( "Can not find %sfile '%s'" % ( kind , path ) ) ) try : f = compat . open_unicode ( path ) except IOError : raise ConfigurationError ( ( "Can not open %sfile '%s'" % ( kind , path ) ) ) try : content = json . load ( f ) except ValueError as e : raise SyntaxError ( ( 'Syntax error in %sfile %s: %s' % ( kind , path , str ( e ) ) ) ) finally : f . close ( ) return content
read a json from path .