Quote:
Originally Posted by chaley
Note that in both cases you must divide the result of mean() by 2, either at the call or later in the list_union. For historical reasons calibre keeps ratings as numbers between 0 and 10. One star == 2, two stars == 4, etc.
|
I forgot about that.
Quote:
Originally Posted by chaley
I also changed the search to include only rated books so that the template can avoid writing xxx:0 if no books with that category are rated.
|
Excluding by search is definitely more elegant.
Quote:
Originally Posted by chaley
BTW: this is fun, all of figuring out the details of how action chains works, the "logic problem" of how to chain the steps, and constructing templates that compute what is needed. I also am finding some template functions that I might add. One is[list_]count_matching(l, sep, pattern) that returns how many items in l match the pattern.
|
It is.

Hopefully the pattern in the function you are proposing is going to be regex.
Quote:
Originally Posted by chaley
The fix to the for statement is now in master source.
|
Good. I will wait a couple of days and go ahead with the changes.