parameters: (self, globe_info="")
docstring: Writes the form for controlling the server.
docstring_summary: Writes the form for controlling the server.
docstring_tokens: Writes the form for controlling the server .
function: def WriteForm(self, globe_info=""):
      """Writes the form for controlling the server."""
      fp = open("local/setup.html")
      setup_form_template = fp.read()
      fp.close()
  
      served_globe_template = """
          <span class="text_callout">[#SERVED_GLOBE_NAME]</span><br/>
          <i>[#SERVED_GLOBE_DESCRIPTION]</i>
          <p>
          [#SERVED_OPTIONS]"""
      local_options = ""
      server_state = ""
      server_links = ""
      local_options = ""
      if tornado.web.globe_.Is2d():
        page = "/maps/map_v3.html?globe=%s" % tornado.web.globe_.GlobeName()
        local_options += (
            """<a class="serving_action"  href="%s">view 2d in browser</a><br>"""
            % page)
  
      if tornado.web.globe_.Is3d() and tornado.web.globe_.config_.UsePlugin():
        page = ("/earth/earth_local.html?globe=%s" %
                tornado.web.globe_.GlobeName())
        local_options += (
            """<a class="serving_action"  href="%s">view 3d in browser</a><br>"""
            % page)
  
      if self.IsBroadcasting():
        server_state = "Broadcasting"
        globe_name = tornado.web.globe_.GlobeName()
        server_links = """
            <a class="serving_action"
            href="/?cmd=local_only">local only</a> | """
      else:
        server_state = "Serving locally"
        globe_name = tornado.web.globe_.GlobeName()
        server_links = """
            <a class="serving_action" href="/?cmd=share">broadcast</a> | """
  
      served_globe_info = served_globe_template.replace(
          "[#SERVED_GLOBE_DESCRIPTION]",
          self.GlobeDescription(tornado.web.globe_))
  
      served_globe_info = served_globe_info.replace("[#SERVED_GLOBE_NAME]",
                                                    globe_name)
      served_globe_info = served_globe_info.replace("[#SERVED_OPTIONS]",
                                                    local_options)
  
      form = setup_form_template.replace("[#SERVED_GLOBE_INFO]",
                                         served_globe_info)
      form = form.replace("[#SERVER_STATE]", server_state)
      form = form.replace("[#SERVER_LINKS]", server_links)
      form = form.replace("[#SERVABLE_GLOBES]",
                          self.GlobeSelectDiv(
                              tornado.web.globe_.GlobeBaseDirectory(),
                              globe_info))
      self.write(form)
function_tokens: def WriteForm ( self , globe_info = "" ) : fp = open ( "local/setup.html" ) setup_form_template = fp . read ( ) fp . close ( ) served_globe_template = """
          <span class="text_callout">[#SERVED_GLOBE_NAME]</span><br/>
          <i>[#SERVED_GLOBE_DESCRIPTION]</i>
          <p>
          [#SERVED_OPTIONS]""" local_options = "" server_state = "" server_links = "" local_options = "" if tornado . web . globe_ . Is2d ( ) : page = "/maps/map_v3.html?globe=%s" % tornado . web . globe_ . GlobeName ( ) local_options += ( """<a class="serving_action"  href="%s">view 2d in browser</a><br>""" % page ) if tornado . web . globe_ . Is3d ( ) and tornado . web . globe_ . config_ . UsePlugin ( ) : page = ( "/earth/earth_local.html?globe=%s" % tornado . web . globe_ . GlobeName ( ) ) local_options += ( """<a class="serving_action"  href="%s">view 3d in browser</a><br>""" % page ) if self . IsBroadcasting ( ) : server_state = "Broadcasting" globe_name = tornado . web . globe_ . GlobeName ( ) server_links = """
            <a class="serving_action"
            href="/?cmd=local_only">local only</a> | """ else : server_state = "Serving locally" globe_name = tornado . web . globe_ . GlobeName ( ) server_links = """
            <a class="serving_action" href="/?cmd=share">broadcast</a> | """ served_globe_info = served_globe_template . replace ( "[#SERVED_GLOBE_DESCRIPTION]" , self . GlobeDescription ( tornado . web . globe_ ) ) served_globe_info = served_globe_info . replace ( "[#SERVED_GLOBE_NAME]" , globe_name ) served_globe_info = served_globe_info . replace ( "[#SERVED_OPTIONS]" , local_options ) form = setup_form_template . replace ( "[#SERVED_GLOBE_INFO]" , served_globe_info ) form = form . replace ( "[#SERVER_STATE]" , server_state ) form = form . replace ( "[#SERVER_LINKS]" , server_links ) form = form . replace ( "[#SERVABLE_GLOBES]" , self . GlobeSelectDiv ( tornado . web . globe_ . GlobeBaseDirectory ( ) , globe_info ) ) self . write ( form )