Skip to content

Commit 2d0a7ac

Browse files
committed
Update [uuid]
1 parent 8ae2cdb commit 2d0a7ac

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

afw_uuid/main.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,37 @@
11
import uuid
2+
from logging import Logger
23

34
from afw_runtime import AFWFuncAbc, AFWResponse
45

56

67
class AFWFunc(AFWFuncAbc):
7-
_data: uuid.UUID | None = None
8+
_uuid: uuid.UUID | None = None
89
_tips = False
910

10-
def make_responses_from_uuid(self, u: uuid.UUID) -> list[AFWResponse]:
11+
def make_responses_from_uuid(self) -> list[AFWResponse]:
1112
return [
1213
AFWResponse(
13-
title=str(u),
14+
title=str(self._uuid),
1415
subtitle="The UUID as a 32-character lowercase hexadecimal string with dash.",
1516
icon=self.icon_info,
1617
),
1718
AFWResponse(
18-
title=u.hex,
19+
title=self._uuid.hex,
1920
subtitle="The UUID as a 32-character lowercase hexadecimal string.",
2021
icon=self.icon_info,
2122
),
2223
AFWResponse(
23-
title=str(u.int),
24+
title=str(self._uuid.int),
2425
subtitle="The UUID as a 128-bit integer.",
2526
icon=self.icon_info,
2627
),
2728
AFWResponse(
28-
title=str(u.urn),
29+
title=str(self._uuid.urn),
2930
subtitle="The UUID as a URN as specified in RFC 4122.",
3031
icon=self.icon_info,
3132
),
3233
AFWResponse(
33-
title=f"{u.version}",
34+
title=f"{self._uuid.version}",
3435
subtitle="The UUID version number (1 through 5, specified is RFC_4122).",
3536
icon=self.icon_info,
3637
arg=4,
@@ -80,20 +81,20 @@ def _guess_input(self) -> uuid.UUID | None:
8081
return u
8182

8283
def _createa_responses(self):
83-
if self._data:
84-
self.append_responses(self.make_responses_from_uuid(self._data))
84+
if self._uuid:
85+
self.append_responses(self.make_responses_from_uuid())
8586

8687
if self._tips:
8788
self.append_tips()
8889

8990
def _process(self) -> None:
90-
self._data = self._guess_input()
91-
if self._data is None:
91+
self._uuid = self._guess_input()
92+
if self._uuid is None:
9293
self._tips = True
9394

9495
self._createa_responses()
9596
return
9697

9798

98-
def main(args: list[str], logger) -> list[AFWResponse]:
99+
def main(args: list[str], logger: Logger) -> list[dict]:
99100
return AFWFunc(args, logger)()

0 commit comments

Comments
 (0)