def read_preferences()

in legacy/autopkg_tools/autopkg_tools.py [0:0]


def read_preferences(args):
  """Read our preferences and return a dict."""
  prefs_dict = {}
  # Equivalent to -l/--list
  prefs_dict['runlist'] = args.list or get_pref('RunList') or []
  # Equivalent to -v/--verbose
  prefs_dict['verbosity'] = (
    bool(args.verbose or get_pref('DebugMode')) or
    False
  )
  # Equivalent to -g/--gitrepo
  prefs_dict['repo_dir'] = (
    args.gitrepo or
    get_pref('GitRepo') or
    autopkglib.get_pref('MUNKI_REPO') or
    None
  )
  # Equivalent to --arc
  prefs_dict['use_arcanist'] = (
    bool(args.arc or get_pref('UseArcanist')) or
    False
  )
  return prefs_dict