Skip to content

Commit 499a28b

Browse files
committed
fix path for file examples
1 parent 5876256 commit 499a28b

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

example/example.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -289,17 +289,17 @@ async def create_and_replace_document_item(client: Client):
289289
ItemSection(id="totpsection", title=""),
290290
],
291291
tags=["test tag 1", "test tag 2"],
292-
document=DocumentCreateParams(name="file.txt",content=Path("file.txt").read_bytes())
292+
document=DocumentCreateParams(name="file.txt",content=Path("./example/file.txt").read_bytes())
293293
)
294294
created_item = await client.items.create(to_create)
295295
# [developer-docs.sdk.python.create-document-item]-end
296296

297-
# [developer-docs.sdk.python.replace-document-item]-start
297+
# [developer-docs.sdk.python.replace-document-item]-start
298298
# Replace the document in the item
299-
replaced_item = await client.items.files.replace_document(created_item,DocumentCreateParams(name="file2.txt",content=Path("file2.txt").read_bytes()))
299+
replaced_item = await client.items.files.replace_document(created_item,DocumentCreateParams(name="file2.txt",content=Path("./example/file2.txt").read_bytes()))
300300
# [developer-docs.sdk.python.replace-document-item]-end
301301

302-
# [developer-docs.sdk.python.read-document-item]-start
302+
# [developer-docs.sdk.python.read-document-item]-start
303303
# Read the document in the item
304304
content = await client.items.files.read(replaced_item.vault_id,replaced_item.id,replaced_item.document)
305305
# [developer-docs.sdk.python.read-document-item]-end
@@ -330,15 +330,15 @@ async def create_attach_and_delete_file_field_item(client: Client):
330330
ItemSection(id="", title=""),
331331
],
332332
tags=["test tag 1", "test tag 2"],
333-
files=[FileCreateParams(name="file.txt",content=Path("file.txt").read_bytes(),sectionId="",fieldId="file_field")]
333+
files=[FileCreateParams(name="file.txt",content=Path("./example/file.txt").read_bytes(),sectionId="",fieldId="file_field")]
334334
)
335335

336336
created_item = await client.items.create(to_create)
337337
# [developer-docs.sdk.python.create-file-field-item]-end
338338

339339
# [developer-docs.sdk.python.attach-file-field-item]-start
340340
# Attach a file to the item
341-
attached_item = await client.items.files.attach(created_item,FileCreateParams(name="file2.txt",content=Path("file2.txt").read_bytes(),sectionId="",fieldId="new_file_field"))
341+
attached_item = await client.items.files.attach(created_item,FileCreateParams(name="file2.txt",content=Path("./example/file2.txt").read_bytes(),sectionId="",fieldId="new_file_field"))
342342
# [developer-docs.sdk.python.attach-file-field-item]-end
343343

344344
# [developer-docs.sdk.python.delete-file-field-item]-start
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)