code: def main():
      
      global server_address
  
      # check the version
      if (sys.version_info[:2] != (2, 5)):
          sys.stderr.write("Python 2.5 only\n")
          sys.exit(1)
  
      # parse the command line arguments
      parser = ArgumentParser(description=__doc__)
      parser.add_argument(
          "host", nargs='?',
          help="address of host (default %r)" % (SERVER_HOST,),
          default=SERVER_HOST,
          )
      parser.add_argument(
          "port", nargs='?', type=int,
          help="server port (default %r)" % (SERVER_PORT,),
          default=SERVER_PORT,
          )
      args = parser.parse_args()
  
      if _debug: _log.debug("initialization")
      if _debug: _log.debug("    - args: %r", args)
  
      # extract the server address and port
      host = args.host
      port = args.port
      server_address = (host, port)
      if _debug: _log.debug("    - server_address: %r", server_address)
  
      # build the stack
      this_console = ConsoleClient()
      if _debug: _log.debug("    - this_console: %r", this_console)
  
      this_middle_man = MiddleMan()
      if _debug: _log.debug("    - this_middle_man: %r", this_middle_man)
  
      this_director = TCPClientDirector()
      if _debug: _log.debug("    - this_director: %r", this_director)
  
      bind(this_console, this_middle_man, this_director)
      bind(MiddleManASE(), this_director)
  
      # create a task manager for scheduled functions
      task_manager = TaskManager()
      if _debug: _log.debug("    - task_manager: %r", task_manager)
  
      # don't wait to connect
      this_director.connect(server_address)
  
      if _debug: _log.debug("running")
  
      run()
docs: Main function, called when run as an application.