def parseConfig(configHandle):
 if isinstance(configHandle, dict):
  config_dict = configHandle
  dirpath = '.'
 else:
  (scheme, host, path, p, q, f) = urlparse(configHandle)
  if (scheme == ''):
   scheme = 'file'
   path = realpath(path)
  if (scheme == 'file'):
   with open(path) as file:
    config_dict = json_load(file)
  else:
   config_dict = json_load(urlopen(configHandle))
  dirpath = ('%s://%s%s' % (scheme, host, (dirname(path).rstrip('/') + '/')))
 return Config.buildConfiguration(config_dict, dirpath)

def parseConfig ( configHandle ) : if isinstance ( configHandle , dict ) : config_dict = configHandle dirpath = '.' else : ( scheme , host , path , p , q , f ) = urlparse ( configHandle ) if ( scheme == '' ) : scheme = 'file' path = realpath ( path ) if ( scheme == 'file' ) : with open ( path ) as file : config_dict = json_load ( file ) else : config_dict = json_load ( urlopen ( configHandle ) ) dirpath = ( '%s://%s%s' % ( scheme , host , ( dirname ( path ) . rstrip ( '/' ) + '/' ) ) ) return Config . buildConfiguration ( config_dict , dirpath )
parse a configuration file and return a configuration object .