mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 13:33:12 +02:00
Allow specifying a non-existent folder when creating a new library. The folder is automatically created
This commit is contained in:
parent
b41c55e811
commit
581d15d8eb
1 changed files with 5 additions and 2 deletions
|
|
@ -180,8 +180,11 @@ def accept(self):
|
|||
if e.errno != errno.EEXIST:
|
||||
raise
|
||||
if not loc or not os.path.exists(loc) or not os.path.isdir(loc):
|
||||
return error_dialog(self, _('Bad location'),
|
||||
_('%s is not an existing folder')%loc, show=True)
|
||||
if action == 'new' and not os.path.exists(loc):
|
||||
os.makedirs(loc)
|
||||
else:
|
||||
return error_dialog(self, _('Bad location'),
|
||||
_('%s is not an existing folder')%loc, show=True)
|
||||
if not self.check_action(action, loc):
|
||||
return
|
||||
self.location.save_history()
|
||||
|
|
|
|||
Loading…
Reference in a new issue