Cleaner connection to db when generating catalog

This commit is contained in:
Kovid Goyal 2010-09-06 16:54:18 -06:00
parent 6132923db6
commit 1ab350b022

View File

@ -27,13 +27,8 @@ def gui_catalog(fmt, title, dbspec, ids, out_file_name, sync, fmt_options, conne
notification=DummyReporter(), log=None): notification=DummyReporter(), log=None):
if log is None: if log is None:
log = Log() log = Log()
if dbspec is None: from calibre.library import db
from calibre.utils.config import prefs db = db()
from calibre.library.database2 import LibraryDatabase2
dbpath = prefs['library_path']
db = LibraryDatabase2(dbpath)
else: # To be implemented in the future
pass
# Create a minimal OptionParser that we can append to # Create a minimal OptionParser that we can append to
parser = OptionParser() parser = OptionParser()