def get_protocol_from_tool_shed_url(tool_shed_url):
 try:
  if (tool_shed_url.find('://') > 0):
   return tool_shed_url.split('://')[0].lower()
 except Exception as e:
  if (tool_shed_url is not None):
   log.exception('Handled exception getting the protocol from Tool Shed URL %s:\n%s', str(tool_shed_url), e)
  return 'http'

def get_protocol_from_tool_shed_url ( tool_shed_url ) : try : if ( tool_shed_url . find ( '://' ) > 0 ) : return tool_shed_url . split ( '://' ) [ 0 ] . lower ( ) except Exception as e : if ( tool_shed_url is not None ) : log . exception ( 'Handled exception getting the protocol from Tool Shed URL %s:\n%s' , str ( tool_shed_url ) , e ) return 'http'
return the protocol from the received tool_shed_url if it exists .