Skip to content

Commit 129ff71

Browse files
Investigamerloonghao
authored andcommitted
refactor(action_descriptor): Fix type hints for doubles
Doubles are akin to float in Python Signed-off-by: MrTeferi <freethoughtleft@gmail.com>
1 parent 1942e9b commit 129ff71

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

photoshop/api/action_descriptor.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def getData(self, key: int) -> int:
7979
"""Gets raw byte data as a string value."""
8080
return self.app.getData(key)
8181

82-
def getDouble(self, key: int) -> int:
82+
def getDouble(self, key: int) -> float:
8383
"""Gets the value of a key of type double."""
8484
return self.app.getDouble(key)
8585

@@ -135,7 +135,7 @@ def getUnitDoubleType(self, key: int) -> int:
135135
"""Gets the unit type of a key of type UnitDouble."""
136136
return self.app.getUnitDoubleType(key)
137137

138-
def getUnitDoubleValue(self, key: int) -> int:
138+
def getUnitDoubleValue(self, key: int) -> float:
139139
"""Gets the unit type of a key of type UnitDouble."""
140140
return self.app.getUnitDoubleValue(key)
141141

@@ -164,7 +164,7 @@ def putData(self, key: int, value: str):
164164
"""Puts raw byte data as a string value."""
165165
self.app.putData(key, value)
166166

167-
def putDouble(self, key: int, value: int):
167+
def putDouble(self, key: int, value: float):
168168
"""Sets the value for a key whose type is double."""
169169
self.app.putDouble(key, value)
170170

@@ -200,7 +200,7 @@ def putString(self, key: int, value: str):
200200
"""Sets the value for a key whose type is string."""
201201
self.app.putString(key, value)
202202

203-
def putUnitDouble(self, key: int, unit_id: int, value: int):
203+
def putUnitDouble(self, key: int, unit_id: int, value: float):
204204
"""Sets the value for a key whose type is a unit value formatted as
205205
double."""
206206
self.app.putUnitDouble(key, unit_id, value)

test/manual_test/manual_test_all_examples.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
"""Manual test all examples."""
22

3+
# Import built-in modules
4+
from pathlib import Path
5+
36
# Import local modules
47
from photoshop.api import Application
5-
from pathlib import Path
8+
69

710
root = Path(__file__).parent.parent.parent.joinpath("examples")
811
for script_file in root.glob("*.py"):

0 commit comments

Comments
 (0)