mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Create the directory pointed to by --with-library if it doesn't exist.
This commit is contained in:
parent
71d9a10698
commit
99a7a5f0f5
@ -35,9 +35,12 @@ def init_qt(args):
|
|||||||
from calibre.gui2.ui import Main
|
from calibre.gui2.ui import Main
|
||||||
parser = option_parser()
|
parser = option_parser()
|
||||||
opts, args = parser.parse_args(args)
|
opts, args = parser.parse_args(args)
|
||||||
if opts.with_library is not None and os.path.isdir(opts.with_library):
|
if opts.with_library is not None:
|
||||||
prefs.set('library_path', os.path.abspath(opts.with_library))
|
if not os.path.exists(opts.with_library):
|
||||||
prints('Using library at', prefs['library_path'])
|
os.makedirs(opts.with_library)
|
||||||
|
if os.path.isdir(opts.with_library):
|
||||||
|
prefs.set('library_path', os.path.abspath(opts.with_library))
|
||||||
|
prints('Using library at', prefs['library_path'])
|
||||||
QCoreApplication.setOrganizationName(ORG_NAME)
|
QCoreApplication.setOrganizationName(ORG_NAME)
|
||||||
QCoreApplication.setApplicationName(APP_UID)
|
QCoreApplication.setApplicationName(APP_UID)
|
||||||
app = Application(args)
|
app = Application(args)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user