Skip to content

Commit

Permalink
refactor: prefer dump/load to dumps/loads
Browse files Browse the repository at this point in the history
  • Loading branch information
NikhilNarayana committed Dec 18, 2021
1 parent 34fccad commit d849a3a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions meleeuploader/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ def __worker(self):
data["ename_min"] = deepcopy(options.ename_min)
data["title_format"] = deepcopy(options.title_format)
with open(consts.form_values_file, "w") as f:
f.write(json.dumps(data))
json.dump(data, f)
if consts.save_on_submit:
self.__save_queue(True)
self._queueref.pop(0)
Expand Down Expand Up @@ -775,7 +775,7 @@ def __save_queue(self, silent=False):
)
if resp == "yes":
with open(consts.queue_values_file, "wb") as f:
f.write(pickle.dumps(self._queueref))
pickle.dump(self._queueref, f)
print("Saved Queue, you can now close the program")
elif resp == "no":
resp = self.question(
Expand All @@ -787,13 +787,13 @@ def __save_queue(self, silent=False):
queueref = pickle.load(f)
queueref.extend(self._queueref)
with open(consts.queue_values_file, "wb") as f:
f.write(pickle.dumps(queueref))
pickle.dump(queueref, f)
print("Saved Queue, you can now close the program")
else:
self.alert("Not saving queue", title="MeleeUploader")
else:
with open(consts.queue_values_file, "wb") as f:
f.write(pickle.dumps(self._queueref))
pickle.dump(self._queueref, f)
print("Saved Queue, you can now close the program")

def __load_queue(self):
Expand Down Expand Up @@ -886,7 +886,7 @@ def __save_form(self, options=[]):
for key, form in self._form_fields.items():
data[key] = deepcopy(form.value)
with open(consts.form_values_file, "w") as f:
f.write(json.dumps(data))
json.dump(data, f)
return data

def __load_form(self, values=[]):
Expand Down

0 comments on commit d849a3a

Please sign in to comment.