Exemple #1
0
	def open_gopher(self, url):
		import gopherlib
		host, selector = splithost(url)
		if not host: raise IOError, ('gopher error', 'no host given')
		type, selector = splitgophertype(selector)
		selector, query = splitquery(selector)
		selector = unquote(selector)
		if query:
			query = unquote(query)
			fp = gopherlib.send_query(selector, query, host)
		else:
			fp = gopherlib.send_selector(selector, host)
		return addinfo(fp, noheaders())
Exemple #2
0
 def open_gopher(self, url):
     import gopherlib
     host, selector = splithost(url)
     if not host: raise IOError, ('gopher error', 'no host given')
     type, selector = splitgophertype(selector)
     selector, query = splitquery(selector)
     selector = unquote(selector)
     if query:
         query = unquote(query)
         fp = gopherlib.send_query(selector, query, host)
     else:
         fp = gopherlib.send_selector(selector, host)
     return addinfo(fp, noheaders())
Exemple #3
0
 def gopher_open(self, req):
     host = req.get_host()
     if not host:
         raise GopherError('no host given')
     host = unquote(host)
     selector = req.get_selector()
     type, selector = splitgophertype(selector)
     selector, query = splitquery(selector)
     selector = unquote(selector)
     if query:
         query = unquote(query)
         fp = gopherlib.send_query(selector, query, host)
     else:
         fp = gopherlib.send_selector(selector, host)
     return addinfourl(fp, noheaders(), req.get_full_url())
Exemple #4
0
 def open_gopher(self, url):
     """Use Gopher protocol."""
     import gopherlib
     host, selector = splithost(url)
     if not host: raise IOError, ('gopher error', 'no host given')
     host = unquote(host)
     type, selector = splitgophertype(selector)
     selector, query = splitquery(selector)
     selector = unquote(selector)
     if query:
         query = unquote(query)
         fp = gopherlib.send_query(selector, query, host)
     else:
         fp = gopherlib.send_selector(selector, host)
     return addinfourl(fp, noheaders(), "gopher:" + url)
Exemple #5
0
 def open_gopher(self, url):
     """Use Gopher protocol."""
     import gopherlib
     host, selector = splithost(url)
     if not host: raise IOError, ('gopher error', 'no host given')
     host = unquote(host)
     type, selector = splitgophertype(selector)
     selector, query = splitquery(selector)
     selector = unquote(selector)
     if query:
         query = unquote(query)
         fp = gopherlib.send_query(selector, query, host)
     else:
         fp = gopherlib.send_selector(selector, host)
     return addinfourl(fp, noheaders(), "gopher:" + url)
 def gopher_open(self, req):
     host = req.get_host()
     if not host:
         raise GopherError("no host given")
     host = unquote(host)
     selector = req.get_selector()
     type, selector = splitgophertype(selector)
     selector, query = splitquery(selector)
     selector = unquote(selector)
     if query:
         query = unquote(query)
         fp = gopherlib.send_query(selector, query, host)
     else:
         fp = gopherlib.send_selector(selector, host)
     return addinfourl(fp, noheaders(), req.get_full_url())
Exemple #7
0
 def gopher_open(self, req):
     # XXX can raise socket.error
     import gopherlib  # this raises DeprecationWarning in 2.5
     host = req.get_host()
     if not host:
         raise GopherError('no host given')
     host = unquote(host)
     selector = req.get_selector()
     type, selector = splitgophertype(selector)
     selector, query = splitquery(selector)
     selector = unquote(selector)
     if query:
         query = unquote(query)
         fp = gopherlib.send_query(selector, query, host)
     else:
         fp = gopherlib.send_selector(selector, host)
     return addinfourl(fp, noheaders(), req.get_full_url())
Exemple #8
0
 def gopher_open(self, req):
     # XXX can raise socket.error
     import gopherlib  # this raises DeprecationWarning in 2.5
     host = req.get_host()
     if not host:
         raise GopherError('no host given')
     host = unquote(host)
     selector = req.get_selector()
     type, selector = splitgophertype(selector)
     selector, query = splitquery(selector)
     selector = unquote(selector)
     if query:
         query = unquote(query)
         fp = gopherlib.send_query(selector, query, host)
     else:
         fp = gopherlib.send_selector(selector, host)
     return addinfourl(fp, noheaders(), req.get_full_url())
Exemple #9
0
"""An extensible library for opening URLs using a variety of protocols
Exemple #10
0
"""Open an arbitrary URL.
Exemple #11
0
"""Open an arbitrary URL.
Exemple #12
0
"""An extensible library for opening URLs using a variety of protocols