(core) Simple Python 3 compatibility changes

Summary: Changes that move towards python 3 compatibility that are easy to review without much thought

Test Plan: The tests

Reviewers: dsagal

Reviewed By: dsagal

Differential Revision: https://phab.getgrist.com/D2873
This commit is contained in:
Alex Hall
2021-06-22 17:12:25 +02:00
parent cc04c6481a
commit 16f297a250
66 changed files with 551 additions and 437 deletions

View File

@@ -54,9 +54,9 @@ class ActionGroup(object):
def get_repr(self):
return {
"calc": map(actions.get_action_repr, self.calc),
"stored": map(actions.get_action_repr, self.stored),
"undo": map(actions.get_action_repr, self.undo),
"calc": [actions.get_action_repr(a) for a in self.calc],
"stored": [actions.get_action_repr(a) for a in self.stored],
"undo": [actions.get_action_repr(a) for a in self.undo],
"direct": self.direct,
"retValues": self.retValues
}
@@ -64,9 +64,9 @@ class ActionGroup(object):
@classmethod
def from_json_obj(cls, data):
ag = ActionGroup()
ag.calc = map(actions.action_from_repr, data.get('calc', []))
ag.stored = map(actions.action_from_repr, data.get('stored', []))
ag.undo = map(actions.action_from_repr, data.get('undo', []))
ag.calc = [actions.action_from_repr(a) for a in data.get('calc', [])]
ag.stored = [actions.action_from_repr(a) for a in data.get('stored', [])]
ag.undo = [actions.action_from_repr(a) for a in data.get('undo', [])]
ag.retValues = data.get('retValues', [])
return ag