Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions WDL/CLI.py
Original file line number Diff line number Diff line change
Expand Up @@ -1752,7 +1752,7 @@ def configure(cfg=None, show=False, force=False, **kwargs):
die("`miniwdl configure` is for interactive use")

from datetime import datetime
import bullet # type: ignore
import questionary # type: ignore
from xdg import XDG_CONFIG_HOME

miniwdl_version = pkg_version()
Expand All @@ -1770,11 +1770,12 @@ def configure(cfg=None, show=False, force=False, **kwargs):
cfg = os.path.join(XDG_CONFIG_HOME, "miniwdl.cfg")

def yes(prompt):
return bullet.Bullet(prompt=prompt, choices=["No", "Yes"]).launch() == "Yes"
answer = questionary.confirm(prompt, qmark="").unsafe_ask()
return bool(answer)

if os.path.exists(cfg):
assert force
logger.warn("Proceeding will overwrite existing configuration file at " + cfg)
logger.warning("Proceeding will overwrite existing configuration file at " + cfg)
sys.stderr.flush()
if not yes("OVERWRITE?"):
sys.exit(0)
Expand All @@ -1799,9 +1800,9 @@ def yes(prompt):
print("\nCall cache JSON file storage directory: ~/.cache/miniwdl/")

if yes("OVERRIDE?"):
options["call_cache"]["dir"] = bullet.Input(
prompt="Call cache directory: ", strip=True
).launch()
options["call_cache"]["dir"] = (
questionary.text("Call cache directory: ").unsafe_ask().strip()
)

print(
textwrap.dedent(
Expand All @@ -1818,9 +1819,10 @@ def yes(prompt):
print("\nDownload cache directory: /tmp/miniwdl_download_cache")

if yes("OVERRIDE?"):
options["download_cache"]["dir"] = bullet.Input(
prompt="Download cache directory: ", strip=True
).launch()
# use questionary text prompt for directory input
options["download_cache"]["dir"] = (
questionary.text("Download cache directory: ").unsafe_ask().strip()
)

print()
if yes("Configure non-public Amazon s3:// access?"):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ dependencies = [
"coloredlogs>=15,<16",
"python-json-logger>=2,<4",
"lark~=1.2",
"bullet>=2,<3",
"questionary>=2,<3",
"psutil>=5,<8"
]

Expand Down
Loading