10260 Commits

Author SHA1 Message Date
Charles Haley
02e9160f37 Fix typo 2010-09-24 15:23:35 +01:00
Charles Haley
93c8836cb6 Changes to template faq 2010-09-24 15:18:03 +01:00
Charles Haley
211bb81113 Put back the sanitize after split on slashes. 2010-09-24 14:43:07 +01:00
Charles Haley
25905a349c Test the 'test' function. Add 're' function and test it. 2010-09-24 13:20:26 +01:00
Charles Haley
5297562383 Refactor code to clean interfaces and remove overly complex loop in bulk edit 2010-09-24 12:57:49 +01:00
Charles Haley
b2a6ed3af4 1) fix bulk edit to not display a tab if library has only composite columns
2) fix a reference to get_custom_field_metadata that I somehow missed.
2010-09-24 12:43:54 +01:00
Charles Haley
ad69ef985a Add a 'test' function to templates. Analogous to lookup, but inserts plain text instead of a template. 2010-09-24 12:27:39 +01:00
Charles Haley
67c7555fd0 Fix content server gui.js bug where it put '...' on the end of a list even if the list was exactly the right size. 2010-09-24 11:36:26 +01:00
Charles Haley
8b9b64a8e6 1) add two tweaks controlling what custom fields the content server displays
2) add & cleanup some field_metadata methods
2010-09-24 11:34:52 +01:00
Charles Haley
97e2c838d0 1) Fix of json codec.
2) make dump_metadata set get_cover=False
2010-09-24 10:50:50 +01:00
Charles Haley
12768864a5 1) fix exception in set_metadata related to composite custom columns
2) make ondevice work with add_books_from_device
2010-09-24 08:54:06 +01:00
Charles Haley
992e5c3c08 Repair damage during conflict resolution 2010-09-24 08:21:10 +01:00
Charles Haley
197e16e62a Merge from trunk 2010-09-24 08:18:20 +01:00
Kovid Goyal
87d70304bd Make metadata backup a little more robust 2010-09-24 00:05:11 -06:00
Kovid Goyal
703ea3c778 propert indentation in generated OPF files 2010-09-23 23:55:56 -06:00
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
552c20134c Launchpad automatic translations update. 2010-09-24 04:40:30 +00:00
Kovid Goyal
c792c47a65 ... 2010-09-23 21:51:57 -06:00
Kovid Goyal
91313ff3a7 Make templating language more capable 2010-09-23 20:51:05 -06:00
Kovid Goyal
448aa8497b Fix #6909 (Trouble in converting non drm prc file to epub) 2010-09-23 20:23:11 -06:00
Kovid Goyal
52b17cc1b9 Fix #6926 (Aldiko on Samsung Moment) 2010-09-23 19:48:52 -06:00
Charles Haley
1a782eb0ff - Some cleanups on templates.
- Make save_to_disk templates sanitize all fields except composites
2010-09-23 20:36:52 +01:00
Kovid Goyal
d7d613b0aa ... 2010-09-23 11:31:22 -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
Charles Haley
5192438503 Mergefrom trunk 2010-09-23 07:40:19 +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