|
|
#16 | ||
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,698
Karma: 16542228
Join Date: Feb 2010
Location: Pennsylvania
Device: Huawei MediaPad M5, LG V30, Boyue T80S, Nexus 7 LTE, K3 3G, Fire HD8
|
Quote:
Quote:
I'm using a template function - I copied something Chaley did for someone for the sub collections for Sony PRS+ to start with and changed it to suit me. I have categories that I want as a top level collection, and genres that I want to combine with the #read column. I used to have series and author collections as well, but CC takes care of those. Code:
def evaluate(self, formatter, kwargs, mi, locals, cats, genre):
categories = set([v.strip() for v in cats.split(',') if v.strip()])
genres = set([v.strip() for v in genre.split(',') if v.strip()])
res = []
tags = [v.strip() for v in kwargs.get('tags') if v.strip()]
isread = kwargs.get('#read')
for v in tags:
if v in categories:
res.append(v)
elif v in genres:
if isread:
res.append('Genre ' + isread+ '|' + v)
else:
res.append('Genre|' + v)
elif isread:
res.append(isread + '|' + v)
else:
res.append('stuff|' + v)
if isread:
res.append(isread)
return ', '.join(res)
Borrowed, Genre unread|Non Fiction, unread read|-bought, Genre read|Mystery - Thriller, read unread|-free, Genre unread|Science Fiction, unread |
||
|
|
|
|
|
#17 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,526
Karma: 8065948
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Thanks everyone for the comments. I don't seem to be too far off. We will see when I get the beta out.
|
|
|
|
| Advert | |
|
|
|
|
#18 | |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,526
Karma: 8065948
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Code:
isread = kwargs.get('#read')
Code:
isread = kwargs.get('#read_yesno')
if isread == 'Yes': isread = 'read'
elif isread == 'No': isread = 'unread'
else: isread = ''
|
|
|
|
|
|
|
#19 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,698
Karma: 16542228
Join Date: Feb 2010
Location: Pennsylvania
Device: Huawei MediaPad M5, LG V30, Boyue T80S, Nexus 7 LTE, K3 3G, Fire HD8
|
Thanks. I knew it should be easy, but my brain has not been cooperating lately.
|
|
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Feature Request - Check Box "Want to Read" | Rudyman | Calibre | 3 | 05-03-2012 01:34 PM |
| "Mark this forum read" is not working | signum | Feedback | 0 | 04-19-2012 11:02 PM |
| New to "Read in Store" feature: Limited Selection | negris123 | Barnes & Noble NOOK | 4 | 06-09-2011 02:08 PM |
| What is the best way to mark books as "read"? | treadlightly | Calibre | 10 | 05-03-2011 09:50 AM |
| "Menu" and "Mark" keys does not work | murad | Sony Reader | 4 | 07-11-2009 01:35 PM |