remoting/host/linux/configure_url_forwarder.py
def restore_default_browser(
    desktop_env: str,
    backup_dict: dict[str, str],
    backup_key: str) -> None:
  """Restores XDG default-web-browser to backup_dict[backup_key] on the given
  desktop environment.

  Args:
    desktop_env: The desktop environment to be configured.
    backup_dict: The dictionary where the previous configuration can be found.
    backup_key: The dictionary key to find the previous configuration.
  """

  if (backup_key not in backup_dict) or not backup_dict[backup_key]:
    print("No setting to restore from", backup_key, file=sys.stderr)
    return
  previous_setting = backup_dict[backup_key]
  if (previous_setting == URL_FORWARDER_DESKTOP_ENTRY or
      previous_setting == XFCE4_WEB_BROWSER_DESKTOP_ENTRY):
    print('Setting to restore from', backup_key, 'is', previous_setting,
          '. Ignored.', file=sys.stderr)
    return
  current_entry = get_default_browser(desktop_env)
  if current_entry == XFCE4_WEB_BROWSER_DESKTOP_ENTRY:
    print('Default browser for', desktop_env, 'is',
          XFCE4_WEB_BROWSER_DESKTOP_ENTRY, '. Ignored.', file=sys.stderr)
    return
  if current_entry != URL_FORWARDER_DESKTOP_ENTRY:
    print('Default browser for', desktop_env, 'is no longer',
          URL_FORWARDER_DESKTOP_ENTRY,
          '. Previously stored setting will not be restored.', file=sys.stderr)
    return
  set_default_browser(desktop_env, previous_setting)
  print('Default browser for', desktop_env, 'has been successfully restored to',
        previous_setting)
Restores XDG default-web-browser to backup_dict[backup_key] on the given
  desktop environment.

  Args:
    desktop_env: The desktop environment to be configured.
    backup_dict: The dictionary where the previous configuration can be found.
    backup_key: The dictionary key to find the previous configuration.
  
Restores XDG default-web-browser to backup_dict[backup_key] on the given
desktop environment.
Restores XDG default - web - browser to backup_dict [ backup_key ] on the given desktop environment .
def restore_default_browser(
    desktop_env: str,
    backup_dict: dict[str, str],
    backup_key: str) -> None:
  if (backup_key not in backup_dict) or not backup_dict[backup_key]:
    print("No setting to restore from", backup_key, file=sys.stderr)
    return
  previous_setting = backup_dict[backup_key]
  if (previous_setting == URL_FORWARDER_DESKTOP_ENTRY or
      previous_setting == XFCE4_WEB_BROWSER_DESKTOP_ENTRY):
    print('Setting to restore from', backup_key, 'is', previous_setting,
          '. Ignored.', file=sys.stderr)
    return
  current_entry = get_default_browser(desktop_env)
  if current_entry == XFCE4_WEB_BROWSER_DESKTOP_ENTRY:
    print('Default browser for', desktop_env, 'is',
          XFCE4_WEB_BROWSER_DESKTOP_ENTRY, '. Ignored.', file=sys.stderr)
    return
  if current_entry != URL_FORWARDER_DESKTOP_ENTRY:
    print('Default browser for', desktop_env, 'is no longer',
          URL_FORWARDER_DESKTOP_ENTRY,
          '. Previously stored setting will not be restored.', file=sys.stderr)
    return
  set_default_browser(desktop_env, previous_setting)
  print('Default browser for', desktop_env, 'has been successfully restored to',
        previous_setting)
def restore_default_browser ( desktop_env : str , backup_dict : dict [ str , str ] , backup_key : str ) -> None : if ( backup_key not in backup_dict ) or not backup_dict [ backup_key ] : print ( "No setting to restore from" , backup_key , file = sys . stderr ) return previous_setting = backup_dict [ backup_key ] if ( previous_setting == URL_FORWARDER_DESKTOP_ENTRY or previous_setting == XFCE4_WEB_BROWSER_DESKTOP_ENTRY ) : print ( 'Setting to restore from' , backup_key , 'is' , previous_setting , '. Ignored.' , file = sys . stderr ) return current_entry = get_default_browser ( desktop_env ) if current_entry == XFCE4_WEB_BROWSER_DESKTOP_ENTRY : print ( 'Default browser for' , desktop_env , 'is' , XFCE4_WEB_BROWSER_DESKTOP_ENTRY , '. Ignored.' , file = sys . stderr ) return if current_entry != URL_FORWARDER_DESKTOP_ENTRY : print ( 'Default browser for' , desktop_env , 'is no longer' , URL_FORWARDER_DESKTOP_ENTRY , '. Previously stored setting will not be restored.' , file = sys . stderr ) return set_default_browser ( desktop_env , previous_setting ) print ( 'Default browser for' , desktop_env , 'has been successfully restored to' , previous_setting )
Restores XDG default-web-browser to backup_dict[backup_key] on the given
desktop environment.
Restores XDG default - web - browser to backup_dict [ backup_key ] on the given desktop environment .
"""Restores XDG default-web-browser to backup_dict[backup_key] on the given
  desktop environment.

  Args:
    desktop_env: The desktop environment to be configured.
    backup_dict: The dictionary where the previous configuration can be found.
    backup_key: The dictionary key to find the previous configuration.
  """
desktop_env
str
The desktop environment to be configured.
The desktop environment to be configured .
backup_dict
dict[str, str]
The dictionary where the previous configuration can be found.
The dictionary where the previous configuration can be found .
backup_key
str
The dictionary key to find the previous configuration.
The dictionary key to find the previous configuration .