mirror of
https://github.com/beetbox/beets.git
synced 2026-12-01 07:28:02 -06:00
add prompt
This commit is contained in:
+3
-1
@@ -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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user