update: Reform.
Browse files- utility.py +6 -6
utility.py
CHANGED
@@ -3,9 +3,9 @@ import os
|
|
3 |
import argparse
|
4 |
|
5 |
def retrieve_secrets(
|
6 |
-
file_path: str | os.PathLike
|
7 |
-
secret_from: str
|
8 |
-
access_type: str
|
9 |
) -> str:
|
10 |
with open(file_path, 'r') as file:
|
11 |
lines = file.read().split('\n\n')
|
@@ -26,9 +26,9 @@ def retrieve_secrets(
|
|
26 |
|
27 |
def main():
|
28 |
parser = argparse.ArgumentParser(description='Retrieve secrets from a file.')
|
29 |
-
parser.add_argument('--file-path', type=str, help='Path to the secrets file')
|
30 |
-
parser.add_argument('--secret-from', type=str, help='Source of the secret')
|
31 |
-
parser.add_argument('--access-type', type=str, default=
|
32 |
|
33 |
args = parser.parse_args()
|
34 |
secret = retrieve_secrets(args.file_path, args.secret_from, args.access_type)
|
|
|
3 |
import argparse
|
4 |
|
5 |
def retrieve_secrets(
|
6 |
+
file_path: str | os.PathLike,
|
7 |
+
secret_from: str,
|
8 |
+
access_type: str
|
9 |
) -> str:
|
10 |
with open(file_path, 'r') as file:
|
11 |
lines = file.read().split('\n\n')
|
|
|
26 |
|
27 |
def main():
|
28 |
parser = argparse.ArgumentParser(description='Retrieve secrets from a file.')
|
29 |
+
parser.add_argument('--file-path', type=str, default="../.ssh/lab_access.txt", help='Path to the secrets file')
|
30 |
+
parser.add_argument('--secret-from', type=str, default="Hugging Face Authentication", help='Source of the secret')
|
31 |
+
parser.add_argument('--access-type', type=str, default="write", help='Type of access')
|
32 |
|
33 |
args = parser.parse_args()
|
34 |
secret = retrieve_secrets(args.file_path, args.secret_from, args.access_type)
|