Compare commits

..

3 Commits

Author SHA1 Message Date
izzy lyseggen 409ac68df0 Merge pull request #101 from specklesystems/izzy/json-acct-tweak
Izzy/json acct tweak
2021-06-04 17:37:25 +01:00
izzy lyseggen 81051a87c1 chore: bump version 2021-06-04 17:36:02 +01:00
izzy lyseggen fca386706b fix(credentials): tweak default base path
align with docs
2021-06-04 17:35:25 +01:00
2 changed files with 5 additions and 7 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
[tool.poetry]
name = "specklepy"
version = "2.2.1"
version = "2.2.2"
description = "The Python SDK for Speckle 2.0"
readme = "README.md"
authors = ["Speckle Systems <devops@speckle.systems>"]
+4 -6
View File
@@ -38,11 +38,9 @@ def get_local_accounts(base_path: str = None) -> List[Account]:
List[Account] -- list of all local accounts or an empty list if no accounts were found
"""
account_storage = SQLiteTransport(scope="Accounts", base_path=base_path)
json_acct_files = [
file
for file in os.listdir(account_storage._base_path)
if file.endswith(".json")
]
json_path = os.path.join(account_storage._base_path, "Accounts")
os.makedirs(json_path, exist_ok=True)
json_acct_files = [file for file in os.listdir(json_path) if file.endswith(".json")]
accounts = []
res = account_storage.get_all_objects()
@@ -51,7 +49,7 @@ def get_local_accounts(base_path: str = None) -> List[Account]:
if json_acct_files:
try:
accounts.extend(
Account.parse_file(os.path.join(account_storage._base_path, json_file))
Account.parse_file(os.path.join(json_path, json_file))
for json_file in json_acct_files
)
except Exception as ex: