code: def _write_user_prefs(self, user_prefs):
          
          with open(self.userPrefs, "w") as f:
              for key, value in user_prefs.items():
                  f.write('user_pref("%s", %s);\n' % (key, json.dumps(value)))
docs: writes the current user prefs dictionary to disk