Skip to content

Commit 04f5ca5

Browse files
SP-659 Python SDK setup script
1 parent c65cc9f commit 04f5ca5

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/bitpay/bitpay_setup.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def select_create_key() -> None:
5555
if input_value == "":
5656
create_new_key()
5757
else:
58-
load_key()
58+
load_key(input_value)
5959
except BitPayException as exe:
6060
print(exe)
6161

@@ -191,9 +191,16 @@ def update_config_file() -> None:
191191
print(exe)
192192

193193

194-
def load_key() -> None:
195-
# TODO: Need to implement this function
196-
pass
194+
def load_key(path: str) -> None:
195+
global private_key_path
196+
197+
private_key_path = path
198+
if not os.path.exists(private_key_path):
199+
print("Please set correct private key path! \n")
200+
pass
201+
202+
with open(os.path.abspath(private_key_path), "r") as private_key:
203+
select_tokens(private_key.read())
197204

198205

199206
if __name__ == "__main__":

0 commit comments

Comments
 (0)