mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 02:53:38 +02:00
IGN:Better error handling when library is on a removable device that no longer exists
This commit is contained in:
parent
72581c6e32
commit
06e5659d79
1 changed files with 9 additions and 1 deletions
|
|
@ -1406,7 +1406,15 @@ def initialize_database(self):
|
|||
dir = os.path.expanduser('~/Library')
|
||||
self.library_path = os.path.abspath(dir)
|
||||
if not os.path.exists(self.library_path):
|
||||
os.makedirs(self.library_path)
|
||||
try:
|
||||
os.makedirs(self.library_path)
|
||||
except:
|
||||
self.library_path = os.path.expanduser('~/Library')
|
||||
error_dialog(self, _('Invalid library location'),
|
||||
_('Could not access %s. Using %s as the library.')%
|
||||
(repr(self.library_path), repr(self.library_path))
|
||||
).exec_()
|
||||
os.makedirs(self.library_path)
|
||||
|
||||
|
||||
def read_settings(self):
|
||||
|
|
|
|||
Loading…
Reference in a new issue