diff --git a/src/calibre/constants.py b/src/calibre/constants.py index 23e0ee439a..03307abcfe 100644 --- a/src/calibre/constants.py +++ b/src/calibre/constants.py @@ -2,7 +2,7 @@ __license__ = 'GPL v3' __copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net' __docformat__ = 'restructuredtext en' __appname__ = 'calibre' -__version__ = '0.4.123' +__version__ = '0.4.124' __author__ = "Kovid Goyal " ''' Various run time constants. diff --git a/src/calibre/devices/cybookg3/books.py b/src/calibre/devices/cybookg3/books.py index b5859e40d0..9a1689af0b 100644 --- a/src/calibre/devices/cybookg3/books.py +++ b/src/calibre/devices/cybookg3/books.py @@ -1,5 +1,5 @@ __license__ = 'GPL v3' -__copyright__ = '2008, Kovid Goyal ' +__copyright__ = '2009, John Schember - - - - Change the author(s) of this book. Multiple authors should be separated by an &. If the author name contains an &, use && to represent it. - - - @@ -111,7 +104,7 @@ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - authors + author_sort @@ -185,13 +178,6 @@ - - - - Change the publisher of this book - - - @@ -330,6 +316,16 @@ + + + + true + + + + + + @@ -615,8 +611,8 @@ accept() - 257 - 646 + 261 + 710 157 @@ -631,8 +627,8 @@ reject() - 325 - 646 + 329 + 710 286 diff --git a/src/calibre/library/database.py b/src/calibre/library/database.py index 122bded333..f14a1174fc 100644 --- a/src/calibre/library/database.py +++ b/src/calibre/library/database.py @@ -943,7 +943,11 @@ ALTER TABLE books ADD COLUMN isbn TEXT DEFAULT "" COLLATE NOCASE; if index_is_id: return self.conn.get('SELECT publisher FROM meta WHERE id=?', (index,), all=False) return self.data[index][3] - + + def publisher_id(self, index, index_is_id=False): + id = index if index_is_id else self.id(index) + return self.conn.get('SELECT publisher from books_publishers_link WHERE book=?', (id,), all=False) + def rating(self, index, index_is_id=False): if index_is_id: return self.conn.get('SELECT rating FROM meta WHERE id=?', (index,), all=False) @@ -1041,6 +1045,14 @@ ALTER TABLE books ADD COLUMN isbn TEXT DEFAULT "" COLLATE NOCASE; def all_series(self): return [ (i[0], i[1]) for i in \ self.conn.get('SELECT id, name FROM series')] + + def all_authors(self): + return [ (i[0], i[1]) for i in \ + self.conn.get('SELECT id, name FROM authors')] + + def all_publishers(self): + return [ (i[0], i[1]) for i in \ + self.conn.get('SELECT id, name FROM publishers')] def all_tags(self): return [i[0].strip() for i in self.conn.get('SELECT name FROM tags') if i[0].strip()] diff --git a/src/calibre/manual/faq.rst b/src/calibre/manual/faq.rst index 7276e177c9..4b3c217698 100644 --- a/src/calibre/manual/faq.rst +++ b/src/calibre/manual/faq.rst @@ -143,6 +143,15 @@ Where are the book files stored? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ When you first run |app|, it will ask you for a folder in which to store your books. Whenever you add a book to |app|, it will copy the book into that folder. Books in the folder are nicely arranged into sub-folders by Author and Title. Metadata about the books is stored in the file ``metadata.db`` (which is a sqlite database). +Why doesn't |app| let me store books in my own directory structure? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The whole point if |app|'s library management features is that they provide an interface for locating books that is *much* more efficient than any possible directory scheme you could come up with for your collection. Indeed, once you become comfortable using |app|'s interface to find, sort and browse your collection, you wont ever feel the need to hunt through the files on your disk to find a book again. By managing books in its own directory struture of Author -> Title -> Book files, |app| is able to achieve a high level of reliability and standardization. + +Why doesn't |app| have a column for foo? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +|app| is designed to have columns for the most frequently and widely used fields. If it does not have a coulmn for your favorite field, you can always add a tag to the book for that piece of information. |app| also supports a general purpose "comments" fields for longer items. + Content From The Web --------------------- diff --git a/src/calibre/manual/news.rst b/src/calibre/manual/news.rst index 871b0beb09..025f38ec22 100644 --- a/src/calibre/manual/news.rst +++ b/src/calibre/manual/news.rst @@ -133,7 +133,7 @@ to the recipe. Finally, lets replace some of the :term:`CSS` that we disabled ea With these additions, our recipe has become "production quality", indeed it is very close to the actual recipe used by |app| for the *BBC*, shown below: -.. literalinclude:: ../web/feeds/recipes/bbc.py +.. literalinclude:: ../web/feeds/recipes/recipe_bbc.py This :term:`recipe` explores only the tip of the iceberg when it comes to the power of |app|. To explore more of the abilities of |app| we'll examine a more complex real life example in the next section. diff --git a/src/calibre/trac/donations/server.py b/src/calibre/trac/donations/server.py index 163851a4f1..cbb68d972e 100644 --- a/src/calibre/trac/donations/server.py +++ b/src/calibre/trac/donations/server.py @@ -102,6 +102,8 @@ class Stats: def get_deviation(self, amounts): l = float(len(amounts)) + if l == 0: + return 0 mean = sum(amounts)/l return sqrt( sum([i**2 for i in amounts])/l - mean**2 )