From f1dfa30e30119afd18e966d1f21c3fc8a913a5a7 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 24 Dec 2009 14:50:56 -0700 Subject: [PATCH] Also auto increment series index when editing in table view --- setup/installer/linux/freeze.py | 2 +- src/calibre/gui2/library.py | 6 +++++- src/calibre/web/feeds/input.py | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/setup/installer/linux/freeze.py b/setup/installer/linux/freeze.py index 2c691e47de..53d8bde506 100644 --- a/setup/installer/linux/freeze.py +++ b/setup/installer/linux/freeze.py @@ -29,7 +29,7 @@ class LinuxFreeze(Command): QTDIR = '/usr/lib/qt4' QTDLLS = ('QtCore', 'QtGui', 'QtNetwork', 'QtSvg', 'QtXml', - 'QtWebKit', 'QtDBus') + 'QtWebKit', 'QtDBus', 'QtXmlPatterns') binary_excludes = ['libGLcore*', 'libGL*', 'libnvidia*'] diff --git a/src/calibre/gui2/library.py b/src/calibre/gui2/library.py index 9148657373..55d6d94967 100644 --- a/src/calibre/gui2/library.py +++ b/src/calibre/gui2/library.py @@ -636,12 +636,16 @@ class BooksModel(QAbstractTableModel): val *= 2 self.db.set_rating(id, val) elif column == 'series': + val = val.strip() pat = re.compile(r'\[([.0-9]+)\]') match = pat.search(val) if match is not None: self.db.set_series_index(id, float(match.group(1))) val = pat.sub('', val) - val = val.strip() + elif val: + ni = self.db.get_next_series_num_for(val) + if ni != 1: + self.db.set_series_index(id, ni) if val: self.db.set_series(id, val) elif column == 'timestamp': diff --git a/src/calibre/web/feeds/input.py b/src/calibre/web/feeds/input.py index 7fe025cd6a..5882dd8e7a 100644 --- a/src/calibre/web/feeds/input.py +++ b/src/calibre/web/feeds/input.py @@ -72,6 +72,8 @@ class RecipeInput(InputFormatPlugin): if builtin: raw = get_builtin_recipe_by_title(title, log=log, download_recipe=False) + if raw is None: + raise ValueError('Failed to find builtin recipe: '+title) recipe = compile_recipe(raw)