media/tools/constrained_network_server/cns.py
def _ServeFile(self, f):
    """Serves the file as an http response."""
    if self._options.local_server_port:
      redirect_url = self._GetServerURL(f, self._options.local_server_port)
      cherrypy.log('Redirect to %s' % redirect_url)
      cherrypy.lib.cptools.redirect(redirect_url, internal=False)
    else:
      sanitized_path = os.path.abspath(os.path.join(self._options.www_root, f))
      return cherrypy.lib.static.serve_file(sanitized_path)
Serves the file as an http response.
Serves the file as an http response.
Serves the file as an http response .
def _ServeFile(self, f):
    if self._options.local_server_port:
      redirect_url = self._GetServerURL(f, self._options.local_server_port)
      cherrypy.log('Redirect to %s' % redirect_url)
      cherrypy.lib.cptools.redirect(redirect_url, internal=False)
    else:
      sanitized_path = os.path.abspath(os.path.join(self._options.www_root, f))
      return cherrypy.lib.static.serve_file(sanitized_path)
def _ServeFile ( self , f ) : if self . _options . local_server_port : redirect_url = self . _GetServerURL ( f , self . _options . local_server_port ) cherrypy . log ( 'Redirect to %s' % redirect_url ) cherrypy . lib . cptools . redirect ( redirect_url , internal = False ) else : sanitized_path = os . path . abspath ( os . path . join ( self . _options . www_root , f ) ) return cherrypy . lib . static . serve_file ( sanitized_path )
Serves the file as an http response.
Serves the file as an http response .
"""Serves the file as an http response."""
self
f