def __init__(self, options, http_archive):
    """Initialize CustomHandlers.

    Args:
      options: original options passed to the server.
      http_archive: reference to the HttpArchive object.
    """
    self.server_manager = None
    self.options = options
    self.http_archive = http_archive
    self.handlers = [
        (GENERATOR_URL_PREFIX, self.get_generator_url_response_code)]
    # screenshot_dir is a path to which screenshots are saved.
    if options.screenshot_dir:
      if not os.path.exists(options.screenshot_dir):
        try:
          os.makedirs(options.screenshot_dir)
        except __HOLE__:
          logging.error('Unable to create screenshot dir: %s',
                         options.screenshot_dir)
          options.screenshot_dir = None
      if options.screenshot_dir:
        self.screenshot_dir = options.screenshot_dir
        self.handlers.append(
            (POST_IMAGE_URL_PREFIX, self.handle_possible_post_image))
dataset/ETHPy150Open chromium/web-page-replay/customhandlers.py/CustomHandlers.__init__