mirror of
https://github.com/beetbox/beets.git
synced 2025-12-15 21:14:19 +01:00
add prompt
This commit is contained in:
parent
9917f2ac3a
commit
b07b0e2f7e
2 changed files with 9 additions and 1 deletions
|
|
@ -903,7 +903,9 @@ class Database:
|
|||
def _path_checker(self, path):
|
||||
newpath = os.path.dirname(path)
|
||||
if not os.path.isdir(newpath):
|
||||
os.makedirs(newpath)
|
||||
from beets.ui.commands import database_dir_creation
|
||||
if database_dir_creation(newpath):
|
||||
os.makedirs(newpath)
|
||||
|
||||
|
||||
def __init__(self, path, timeout=5.0):
|
||||
|
|
|
|||
|
|
@ -1398,6 +1398,12 @@ version_cmd = ui.Subcommand(
|
|||
version_cmd.func = show_version
|
||||
default_commands.append(version_cmd)
|
||||
|
||||
# database_location: return true if user wants to create the parent directories.
|
||||
def database_dir_creation(path):
|
||||
# Ask the user for a choice.
|
||||
return ui.input_yn("{} does not exist, create it (Y/n)?"
|
||||
.format(displayable_path(path)))
|
||||
|
||||
|
||||
# modify: Declaratively change metadata.
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue