def __GetElementTree(protocol, server, port, path, sslContext):
 if (protocol == 'https'):
  kwargs = ({'context': sslContext} if sslContext else {})
  conn = http_client.HTTPSConnection(server, port=port, **kwargs)
 elif (protocol == 'http'):
  conn = http_client.HTTPConnection(server, port=port)
 else:
  raise Exception((('Protocol ' + protocol) + ' not supported.'))
 conn.request('GET', path)
 response = conn.getresponse()
 if (response.status == 200):
  try:
   tree = ElementTree.fromstring(response.read())
   return tree
  except ExpatError:
   pass
 return None

def __GetElementTree ( protocol , server , port , path , sslContext ) : if ( protocol == 'https' ) : kwargs = ( { 'context' : sslContext } if sslContext else { } ) conn = http_client . HTTPSConnection ( server , port = port , ** kwargs ) elif ( protocol == 'http' ) : conn = http_client . HTTPConnection ( server , port = port ) else : raise Exception ( ( ( 'Protocol ' + protocol ) + ' not supported.' ) ) conn . request ( 'GET' , path ) response = conn . getresponse ( ) if ( response . status == 200 ) : try : tree = ElementTree . fromstring ( response . read ( ) ) return tree except ExpatError : pass return None
private method that returns a root from elementtree for a remote xml document .