parameters: (self, request)
docstring: Reads requested packet from glb file.
docstring_summary: Reads requested packet from glb file.
docstring_tokens: Reads requested packet from glb file .
function: def _FlatFileRequest(self, request):
      """Reads requested packet from glb file."""
      arguments = request.split("-")
      tag = arguments[0]
      qtnode = arguments[1]
      request_type = arguments[2][0]
      version = arguments[2][2:]
  
      if tag == "q2" and request_type == "q":
        # Read quadtree packet from globe package.
        content = self.globe_.ReadQtPacket(qtnode)
        common.utils.WriteHeader("application/octet-stream")
  
      elif (tag == "f1c" or tag == "f1") and request_type == "i":
        # Read imagery packet from globe package.
        content = self.globe_.ReadImageryPacket(qtnode)
        common.utils.WriteHeader("application/octet-stream")
  
      elif (tag == "f1c" or tag == "f1") and request_type == "t":
        # Read terrain packet from globe package.
        content = self.globe_.ReadTerrainPacket(qtnode)
        common.utils.WriteHeader("application/octet-stream")
  
      elif (tag == "f1c" or tag == "f1") and request_type == "d":
        # Read vector packet.
        channel = int(version.split(".")[0])
        # Read terrain packet from globe package.
        content = self.globe_.ReadVectorPacket(qtnode, channel)
        common.utils.WriteHeader("application/octet-stream")
  
      elif tag == "lf":
        # Read icon packet.
        icon_args = arguments[2].split("&")
        content = self.globe_.ReadFile(icon_args[0])
        common.utils.WriteHeader("image/png")
  
      else:
        raise portable_exceptions.PortableException(
            "unknown packet request: %s" % self.request.uri)
  
      print content
function_tokens: def _FlatFileRequest ( self , request ) : arguments = request . split ( "-" ) tag = arguments [ 0 ] qtnode = arguments [ 1 ] request_type = arguments [ 2 ] [ 0 ] version = arguments [ 2 ] [ 2 : ] if tag == "q2" and request_type == "q" : # Read quadtree packet from globe package. content = self . globe_ . ReadQtPacket ( qtnode ) common . utils . WriteHeader ( "application/octet-stream" ) elif ( tag == "f1c" or tag == "f1" ) and request_type == "i" : # Read imagery packet from globe package. content = self . globe_ . ReadImageryPacket ( qtnode ) common . utils . WriteHeader ( "application/octet-stream" ) elif ( tag == "f1c" or tag == "f1" ) and request_type == "t" : # Read terrain packet from globe package. content = self . globe_ . ReadTerrainPacket ( qtnode ) common . utils . WriteHeader ( "application/octet-stream" ) elif ( tag == "f1c" or tag == "f1" ) and request_type == "d" : # Read vector packet. channel = int ( version . split ( "." ) [ 0 ] ) # Read terrain packet from globe package. content = self . globe_ . ReadVectorPacket ( qtnode , channel ) common . utils . WriteHeader ( "application/octet-stream" ) elif tag == "lf" : # Read icon packet. icon_args = arguments [ 2 ] . split ( "&" ) content = self . globe_ . ReadFile ( icon_args [ 0 ] ) common . utils . WriteHeader ( "image/png" ) else : raise portable_exceptions . PortableException ( "unknown packet request: %s" % self . request . uri ) print content