Skip to content

Commit 12097da

Browse files
committed
Update paths for all OSes
1 parent d56bd05 commit 12097da

File tree

4 files changed

+26
-9
lines changed

4 files changed

+26
-9
lines changed

example/desktop_app.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,21 @@ async def main():
88
# Connects to the 1Password desktop app.
99
client = await Client.authenticate(
1010
auth=DesktopAuth(
11-
account_name="AndiTituTest" # Set to your 1Password account name.
11+
account_name="YouAccountNameAsShownInDesktopApp" # Set to your 1Password account name.
1212
),
1313
# Set the following to your own integration name and version.
1414
integration_name="My 1Password Integration",
1515
integration_version="v1.0.0",
1616
)
1717

1818
# [developer-docs.sdk.python.list-vaults]-start
19-
vaults = await client.vaults.list()
19+
vaults = await client.vaults.list(params=VaultListParams(decrypt_details=False))
2020
for vault in vaults:
2121
print(vault)
2222
# [developer-docs.sdk.python.list-vaults]-end
2323

2424
# [developer-docs.sdk.python.list-items]-start
25-
overviews = await client.items.list("xw33qlvug6moegr3wkk5zkenoa")
25+
overviews = await client.items.list(vault_id=vaults[0].id)
2626
for overview in overviews:
2727
print(overview.title)
2828
# [developer-docs.sdk.python.list-items]-end

src/onepassword/desktop_core.py

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,32 @@
22
import json
33
import os
44
import base64
5+
import platform
6+
from pathlib import Path
57
from ctypes import c_uint8, c_size_t, c_int32, POINTER, byref, c_void_p
6-
from .core import UniffiCore
78
from onepassword.errors import raise_typed_exception
89

910

1011
def find_1password_lib_path():
11-
locations = [
12-
"/Applications/1Password.app/Contents/Frameworks/libop_sdk_ipc_client.dylib",
13-
]
12+
system = platform.system()
13+
14+
if system == "Darwin":
15+
locations = [
16+
"/Applications/1Password.app/Contents/Frameworks/libop_sdk_ipc_client.dylib",
17+
str(Path.home() / "Applications/1Password.app/Contents/Frameworks/libop_sdk_ipc_client.dylib"),
18+
]
19+
20+
elif system == "Windows":
21+
locations = [
22+
r"C:\Program Files\1Password\op_sdk_ipc_client.dll",
23+
r"C:\Program Files (x86)\1Password\op_sdk_ipc_client.dll",
24+
str(Path.home() / r"AppData\Local\1Password\op_sdk_ipc_client.dll"),
25+
]
26+
27+
elif system == "Linux":
28+
locations = [
29+
"/opt/1Password/lib/libop_sdk_ipc_client.so",
30+
]
1431

1532
for lib_path in locations:
1633
if os.path.exists(lib_path):

src/onepassword/items_shares.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Code generated by op-codegen - DO NO EDIT MANUALLY
22

3-
from typing import Optional, List
3+
from typing import List
44
from pydantic import TypeAdapter
55
from .types import Item, ItemShareAccountPolicy, ItemShareParams, ValidRecipient
66

src/onepassword/secrets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Code generated by op-codegen - DO NO EDIT MANUALLY
22

33
from .core import Core, UniffiCore
4-
from typing import Optional, List
4+
from typing import List
55
from pydantic import TypeAdapter
66
from .types import GeneratePasswordResponse, PasswordRecipe, ResolveAllResponse
77

0 commit comments

Comments
 (0)