media/tools/constrained_network_server/cns.py
def _GetServerURL(self, f, port, **kwargs):
    """Returns a URL for local server to serve the file on given port.

    Args:
      f: file name to serve on local server. Relative to www_root.
      port: Local server port (it can be a configured constrained port).
      kwargs: extra parameteres passed in the URL.
    """
    url = '%s?f=%s&' % (cherrypy.url(), f)
    if self._options.local_server_port:
      url = '%s/%s?' % (
          cherrypy.url().replace('ServeConstrained', self._options.www_root), f)

    url = url.replace(':%d' % self._options.port, ':%d' % port)
    extra_args = urllib.urlencode(kwargs)
    if extra_args:
      url += extra_args
    return url
Returns a URL for local server to serve the file on given port.

    Args:
      f: file name to serve on local server. Relative to www_root.
      port: Local server port (it can be a configured constrained port).
      kwargs: extra parameteres passed in the URL.
    
Returns a URL for local server to serve the file on given port.
Returns a URL for local server to serve the file on given port .
def _GetServerURL(self, f, port, **kwargs):
    url = '%s?f=%s&' % (cherrypy.url(), f)
    if self._options.local_server_port:
      url = '%s/%s?' % (
          cherrypy.url().replace('ServeConstrained', self._options.www_root), f)
    url = url.replace(':%d' % self._options.port, ':%d' % port)
    extra_args = urllib.urlencode(kwargs)
    if extra_args:
      url += extra_args
    return url
def _GetServerURL ( self , f , port , ** kwargs ) : url = '%s?f=%s&' % ( cherrypy . url ( ) , f ) if self . _options . local_server_port : url = '%s/%s?' % ( cherrypy . url ( ) . replace ( 'ServeConstrained' , self . _options . www_root ) , f ) url = url . replace ( ':%d' % self . _options . port , ':%d' % port ) extra_args = urllib . urlencode ( kwargs ) if extra_args : url += extra_args return url
Returns a URL for local server to serve the file on given port.
Returns a URL for local server to serve the file on given port .
"""Returns a URL for local server to serve the file on given port.

    Args:
      f: file name to serve on local server. Relative to www_root.
      port: Local server port (it can be a configured constrained port).
      kwargs: extra parameteres passed in the URL.
    """
self
f
file name to serve on local server. Relative to www_root.
file name to serve on local server . Relative to www_root .
port
Local server port (it can be a configured constrained port).
Local server port ( it can be a configured constrained port ) .
kwargs
extra parameteres passed in the URL.
extra parameteres passed in the URL .