Skip to content

Commit

Permalink
style(action_manager): ran black and isort
Browse files Browse the repository at this point in the history
Signed-off-by: TsXor <[email protected]>
  • Loading branch information
TsXor committed Sep 7, 2022
1 parent 2ab813a commit 0089f9d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions photoshop/api/action_manager/_main_types/action_descriptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ def dump(self) -> dict:
# This is a dict comprehension.
ddict = {"_classID": self.classID}
ddict.update(
{key: (value.dump() if hasattr(value := self.uget(key), "dump") else value) for key in self}
) # noqa
{key: (value.dump() if hasattr(value := self.uget(key), "dump") else value) for key in self} # noqa
)
return ddict

def _unpacker(self) -> tuple:
Expand Down
10 changes: 5 additions & 5 deletions photoshop/api/action_manager/_main_types/action_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class ActionList(ABC):
def load(cls, alist: list, namespace: dict): # pass globals() for namespace
new = cls()
for v in alist:
v = v if (dtype := parsetype(v)) == "others" else namespace[dtype].load(v)
v = v if (dtype := parsetype(v)) == "others" else namespace[dtype].load(v) # noqa
new.uput(v)
return new

Expand All @@ -41,7 +41,7 @@ def uput(self, val: Any):
typestr, args = unpack(val)
# ActionList type checking
assert (
True if (dtype := self.dtype) is None else dtype == typestr
True if (dtype := self.dtype) is None else dtype == typestr # noqa
), "ActionList can only hold things of the same type"
put_func = getattr(self, "put" + typestr)
put_func(*args)
Expand All @@ -68,7 +68,7 @@ def dump(self) -> list:
def load(cls, alist: list, namespace: dict): # pass globals() for namespace
new = cls()
for v in alist:
v = v if (dtype := parsetype(v)) == "others" else namespace[dtype].load(v)
v = v if parsetype(v) == "others" else namespace[parsetype(v)].load(v)
new.uput(v)
return new

Expand All @@ -77,8 +77,8 @@ def uput(self, val: Any):
typestr, args = unpack(val)
# ActionList type checking
assert (
True if (dtype := self.dtype) is None else dtype == typestr
), "ActionList can only hold things of the same type"
True if self.dtype is None else self.dtype == typestr
), "ActionList can only hold things of the same type" # noqa
put_func = getattr(self, "put" + typestr)
put_func(*args)

Expand Down
6 changes: 4 additions & 2 deletions photoshop/api/action_manager/js_converter/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,10 @@ def parseref(tdict):
plist.extend(
[
(
str2refgetpacker[val["type"]](e) if type(val := e["Value"]) == dict else str2refgetpacker["default"](e)
) # noqa
str2refgetpacker[val["type"]](e)
if type(val := e["Value"]) == dict # noqa
else str2refgetpacker["default"](e)
)
for e in d2l
]
)
Expand Down

0 comments on commit 0089f9d

Please sign in to comment.