From 00c85a1967dc6ccf769fa6003d9dc21ba86ad958 Mon Sep 17 00:00:00 2001 From: Michael Woods Date: Sun, 16 Feb 2025 13:39:00 -0500 Subject: [PATCH] Fix to allow fetching object data. --- src/packetserver/client/objects.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/packetserver/client/objects.py b/src/packetserver/client/objects.py index dbfd087..216f2ee 100644 --- a/src/packetserver/client/objects.py +++ b/src/packetserver/client/objects.py @@ -76,7 +76,8 @@ def post_file(client: Client, bbs_callsign: str, file_path: str, private=True, n data = open(file_path, mode).read() return post_object(client, bbs_callsign, obj_name, data, private=private) -def get_object_by_uuid(client: Client, bbs_callsign: str, uuid: Union[str, bytes, UUID, int]): +def get_object_by_uuid(client: Client, bbs_callsign: str, uuid: Union[str, bytes, UUID, int], + include_data=True) -> ObjectWrapper: if type(uuid) is str: uid = UUID(uuid) elif type(uuid) is bytes: @@ -89,6 +90,8 @@ def get_object_by_uuid(client: Client, bbs_callsign: str, uuid: Union[str, bytes raise ValueError("uuid must represent a UUID object") req = Request.blank() + if include_data: + req.set_var('fetch', 1) req.path = "object" req.set_var('uuid', uid.bytes) req.method = Request.Method.GET