File tree Expand file tree Collapse file tree 3 files changed +11
-7
lines changed Expand file tree Collapse file tree 3 files changed +11
-7
lines changed Original file line number Diff line number Diff line change 4747 - name : Lint with Ruff
4848 run : |
4949 pip install ruff
50- ruff check --output-format=github --exclude=src/onepassword/lib/ .
50+ ruff check --output-format=github --exclude=src/onepassword/lib/,example/ .
5151 continue-on-error : true
Original file line number Diff line number Diff line change 22import os
33from onepassword import *
44
5-
65async def main ():
76 # Gets your service account token from the OP_SERVICE_ACCOUNT_TOKEN environment variable.
87 token = os .getenv ("OP_SERVICE_ACCOUNT_TOKEN" )
@@ -24,7 +23,7 @@ async def main():
2423 id = "" ,
2524 title = "MyName" ,
2625 category = "Login" ,
27- vault_id = "vault_id " ,
26+ vault_id = "q73bqltug6xoegr3wkk2zkenoq " ,
2827 fields = [
2928 ItemField (
3029 id = "username" ,
@@ -48,7 +47,7 @@ async def main():
4847 print (dict (created_item ))
4948
5049 # Retrieve an item from your vault.
51- item = await client .items .get (" vault_id" , created_item .id )
50+ item = await client .items .get (created_item . vault_id , created_item .id )
5251
5352 print (dict (item ))
5453
@@ -59,7 +58,7 @@ async def main():
5958 print (dict (updated_item ))
6059
6160 # Delete a item from your vault.
62- await client .items .delete (" vault_id" , updated_item .id )
61+ await client .items .delete (created_item . vault_id , updated_item .id )
6362
6463
6564if __name__ == "__main__" :
Original file line number Diff line number Diff line change 55from .secrets import Secrets
66from .items import Items
77
8+ import sys
9+ import inspect
10+ import typing
811
912__all__ = [
1013 "Client" ,
1417 "DEFAULT_INTEGRATION_VERSION" ,
1518]
1619
17- if hasattr (types , "__all__" ):
18- __all__ += types .__all__
20+ for name , obj in inspect .getmembers (sys .modules ["onepassword.types" ]):
21+ # Add all classes and instances of typing.Literal defined in types.py.
22+ if (inspect .isclass (obj ) and inspect .getmodule (obj ) == sys .modules ["onepassword.types" ]) or type (eval (name )) == typing ._LiteralGenericAlias :
23+ __all__ .append (name )
You can’t perform that action at this time.
0 commit comments