aboutsummaryrefslogtreecommitdiff
path: root/regional-currency/ask_questions.py
diff options
context:
space:
mode:
Diffstat (limited to 'regional-currency/ask_questions.py')
-rwxr-xr-xregional-currency/ask_questions.py41
1 files changed, 41 insertions, 0 deletions
diff --git a/regional-currency/ask_questions.py b/regional-currency/ask_questions.py
index 200f779..49a1dd3 100755
--- a/regional-currency/ask_questions.py
+++ b/regional-currency/ask_questions.py
@@ -267,3 +267,44 @@ ask_str(
"8. Enter the admin password for the bank (or press enter to autogenerate password): ",
str(uuid.uuid4()),
)
+
+def ask_tos_file(name: str, msg: str) -> str:
+ "Prompt the user to select a ToS/privacy policy"
+
+ # msg = "9.1. Enter the filename of the ToS. Some available options are:\n"
+ tos_msg = msg
+
+ # Recollect example ToS files
+ tos_path = "/usr/share/taler/terms"
+ for f in os.listdir(tos_path):
+ tos_file = os.path.join(tos_path, f)
+ if os.path.isfile(tos_file) and f.endswith(".rst"):
+ tos_msg += f"- {tos_file}\n"
+
+ tos_msg += "=> "
+
+ return ask_str(
+ name,
+ tos_msg,
+ os.path.join(tos_path, "exchange-tos-v0.rst")
+ )
+
+if ask_yes_no(
+ "DO_EXCHANGE_TERMS",
+ "9. Do you wish to configure terms of service (ToS) for the exchange? (Y/n): ",
+ False,
+):
+ ask_tos_file(
+ "EXCHANGE_TERMS_FILE",
+ "9.1. Enter the filename of the ToS. Some available options are:\n"
+ )
+
+if ask_yes_no(
+ "DO_EXCHANGE_PRIVACY",
+ "10. Do you wish to configure a privacy policy for the exchange? (Y/n): ",
+ False,
+):
+ ask_tos_file(
+ "EXCHANGE_PRIVACY_FILE",
+ "10.1. Enter the filename of the privacy policy. Some available options are:\n"
+ )