9927 Commits

Author SHA1 Message Date
Kovid Goyal
f46d919c75 Add thread to GUI for distributed metadata backup 2010-09-23 23:50:22 -06:00
Kovid Goyal
1ad0eebd56 API for dealing with distributed metadata backup 2010-09-23 23:30:16 -06:00
Kovid Goyal
91313ff3a7 Make templating language more capable 2010-09-23 20:51:05 -06:00
Charles Haley
232ce4748d Back out the models 'strip' change 2010-09-23 17:59:50 +01:00
Charles Haley
b2d5f740b5 1) Put back get_metadata code for format, and fix format.
2) Ensure that gui editing does an lcase.
2010-09-23 17:46:46 +01:00
Kovid Goyal
676fc555a7 Pull from trunk 2010-09-23 10:35:36 -06:00
Charles Haley
36ce874081 Fix db2.get_metadata to handle format correctly (it is already a list)
Fix Metadata to put composite fields back where they belong
2010-09-23 17:18:49 +01:00
Kovid Goyal
b940570504 IPC: Store results file in the calibre temp dir and also dont die if for some reason removing result file fails 2010-09-23 09:33:49 -06:00
Kovid Goyal
82f577452b Pull from trunk 2010-09-23 08:46:09 -06:00
Kovid Goyal
7a20e117ce Database: Fix regression that caused has_cover to create empty directories unneccessarily 2010-09-23 08:45:37 -06:00
Kovid Goyal
e41a54c1d7 Neal's Nuze by Tony Stegall. Fixes #6917 (Recipe for Neal's Nuze) 2010-09-23 08:31:27 -06:00
Kovid Goyal
3db15e955b Fix #6797 (Fetch News Russian Table of Contents MOBI format) 2010-09-23 08:22:50 -06:00
Kovid Goyal
30c96df505 ... 2010-09-23 08:13:51 -06:00
Charles Haley
ea29f4b683 Changes:
1) complete rewrite of composite field processing
-- creation of of formatter class in utils
-- change template validator (prefs/save_template.py) to use new formatting class
-- change save_to_disk to use new formatting class
-- change Metadata class to use new formatting class
-- Check for mutually recursive composite fields
-- change caches.py to use the 'get' interface (now the right one) for composites

2) Add template validation to the base deviceconfig plugin. It checks if the display widget has a 'validate' method, and if so, it calls it.

3) Change models.py so that composite templates can be edited on the library display.
-- back out the changes that set 'editable = False'

4) Fix problem in models.py where book info view was not being updated when a field is changed on library display

5) Changed save_to_disk to permit slashes in field specifications. Did this by splitting the template after template processing. This gives us basic variable folder structures
Example: Simple example: we want the folder structure series/series_index - title. If series does not exist, then the title should be in the top folder.
Template: {series:||/}{series_index:|| - }{title}

6) Change syntax for extended templates
-- prefixes and suffixes have moved to the end of the field specification. 
Syntax: {series:|prefix value|suffix value}
You can put a standard python format specification between the : and the first |.
Either zero or two bars must be present.

7) Addition of some built-in functions to template processing. These appear in the format part.
Syntax: {title:uppercase()|prefix value|suffix value}
Functions apply to the value of the field in the format specification.
The functions available are:
-- uppercase(), lowercase(), titlecase(), capitalise()

-- ifempty(text)
If the field is empty, replace it with text.

-- shorten(from start, center string, from end)
Replace the field with a shortened version. The shortened version is found by joining the field's first 'from start' characters, the center string, and the field's last 'from end' characters.
Example: assume that the title is 'Values of beta will give rise to dom'. The field specification
{title:shorten(6,---,6)} will produce the result 'Values---to dom'

-- lookup(key if field not empty, key if field empty)
Replace the value of 'field' with the value of another field. The first field key (lookup name) is used if 'field' is not empty. The second field key is used if field is empty. This, coupled with composite fields and the change to save_to_disk above, facilitates complex variable folder trees on devices.
Example: If a book has a series, then we want the folder structure series/series index - title.fmt. If the book does not have a series, then we want the folder structure genre/author_sort/title.fmt. If the book has no genre, use 'Unknown'. To accomplish this, we:
1) create a composite field named AA containing '{series:||}/{series_index} - {title'.
2) create a composite field named BB containing '{#genre:ifempty(Unknown)}/{author_sort}/{title}
3) set the save template to '{series:lookup(AA,BB)}
2010-09-23 14:36:47 +01:00
GRiker
cee9c6e6db GwR fix regression with NCX encoding #6797 2010-09-23 06:35:13 -07:00
Kovid Goyal
d9e5e74695 Console now has history 2010-09-23 01:02:03 -06:00
Charles Haley
350f0e8ed9 Merge from trunk 2010-09-23 07:42:56 +01:00
Kovid Goyal
9b44f55785 ... 2010-09-22 21:54:58 -06:00
Kovid Goyal
950f592b87 ... 2010-09-22 21:48:17 -06:00
Kovid Goyal
c5e26ad9d5 Refactor console to run interpreter in separate process 2010-09-22 21:43:08 -06:00
Kovid Goyal
22b96a0dda Pull from trunk 2010-09-22 20:25:37 -06:00
Kovid Goyal
901534a57b Fix #6902 (searching for a title or part of a title) 2010-09-22 19:21:31 -06:00
Timothy Legge
48cb1d3138 Fix 6902 - If Title is None set to Unknown 2010-09-22 21:45:44 -03:00
Kovid Goyal
69e4cb0065 ... 2010-09-22 17:05:35 -06:00
Kovid Goyal
2bd3bda0fe Restore case renaming code, but in a more robust form 2010-09-22 16:41:09 -06:00
Kovid Goyal
3c4e3beb63 Pull from trunk 2010-09-22 16:17:27 -06:00
Kovid Goyal
564c16de9f ... 2010-09-22 16:16:04 -06:00
Kovid Goyal
7e233696a1 ... 2010-09-22 16:11:53 -06:00
Kovid Goyal
c406114722 Fix #6914 (Calibre misfiles books (during a rename?)) 2010-09-22 16:07:39 -06:00
Charles Haley
9a61af81ed Merge from trunk 2010-09-22 21:00:43 +01:00
Charles Haley
8a9ae38ebf Change to fix to make the value unicode in format_field_extended. This is a more general fix. Note that the orig_field has not been changed. 2010-09-22 21:00:25 +01:00
Charles Haley
f280cc956f Fix template bugs introduced by using + instead of '%s' 2010-09-22 20:56:08 +01:00
Kovid Goyal
671d618254 Beta three 2010-09-22 10:40:11 -06:00
Charles Haley
bd8a206219 Changes to faq 2010-09-22 17:10:57 +01:00
Charles Haley
818a2248d5 Merge from trunk 2010-09-22 16:59:14 +01:00
Kovid Goyal
bfc3e63980 ... 2010-09-22 09:57:33 -06:00
Kovid Goyal
63db48962c Add support for conditional text to template mini-language 2010-09-22 09:55:59 -06:00
Kovid Goyal
9112277d00 ... 2010-09-22 09:50:01 -06:00
Charles Haley
b1250a6db1 Add prefix and postfix to template values. Syntax: either '{key}' or '{txt1|key|txt2}'. In the second case, if val[key] is not empty, then the result is 'txt1' + val[key] + txt2. 2010-09-22 16:43:28 +01:00
Kovid Goyal
b0c46114b4 pull from trunk 2010-09-22 09:32:34 -06:00
Kovid Goyal
ced6322e3f Rmf24.pl by Tomasz Dlugosz and Gazeta Pomorska by Richard z 2010-09-22 09:21:54 -06:00
Kovid Goyal
ffdb019ba1 pull from trunk 2010-09-22 09:10:12 -06:00
Kovid Goyal
edb26bcfa8 ... 2010-09-22 09:09:55 -06:00
Kovid Goyal
9c249576c0 Add option to bulk change titles to Title Case. Allow composite fields to be used as source fields in S&R. Performance optimizations in get_metadata 2010-09-22 09:03:17 -06:00
Charles Haley
7893c01807 Three changes:
1) make get_metadata return an unverified list of formats. Avoids a file system operation per format
2) enhancement request #2845
3) permit composite fields as search/replace source fields.
2010-09-22 13:22:02 +01:00
Charles Haley
2c1debbe79 Merge from trunk 2010-09-22 11:44:43 +01:00
Kovid Goyal
fdd839af7c Ctrl+Home and Ctrl+End now work 2010-09-21 22:46:54 -06:00
Kovid Goyal
a41f481ee7 Backspace and delete now work in console 2010-09-21 22:28:49 -06:00
Kovid Goyal
e7adf45c01 Restart and context menu added to console 2010-09-21 22:21:36 -06:00
Kovid Goyal
5cab12e26f Don't use special tooltip style on linux. Draw yellow color on splitter handle in background 2010-09-21 22:04:01 -06:00