04-02-2011, 10:02 PM | #16 |
Enthusiast
Posts: 35
Karma: 10
Join Date: Feb 2011
Device: Kindle Paperwhite, Kobo Aura One
|
pchrist7
Well I just upgraded to the latest version of Calibre (0.7.53) and I guess some changes have been implemented in the code. My Read Staus Column was giving me an error... something about an invalid arg count. I then modified the template for an arg count of 4 (down from 5) and now I don't get the error message, but now in the case of a book that has been read the column shows a date instead of Read. Any ideas? I also noticed that when I was in the plugboard that if I had my Kindle DX attached it showed "device attached Kindle_DX" and if I had my wifes K3 attached it showed "device attached Kindle2". I am not a programmer and don't have a clue, but I was wondering if Calibre is able to recognize the difference between the 2 devices if somehow that could be used to create 2 separate Read Status Columns??? |
04-03-2011, 01:10 AM | #17 | ||
Addict
Posts: 385
Karma: 6514
Join Date: Aug 2010
Location: Denmark
Device: Kindle 3 3G+Wifi, Oasis
|
Quote:
Quote:
I might be wrong, but I think not. Developpers ? Last edited by pchrist7; 04-03-2011 at 01:12 AM. Reason: spelling, formats |
||
Advert | |
|
04-05-2011, 05:32 PM | #18 |
Enthusiast
Posts: 35
Karma: 10
Join Date: Feb 2011
Device: Kindle Paperwhite, Kobo Aura One
|
Hi pchrist7
This is the code I am using: Code:
def evaluate(self, formatter, kwargs, mi, locals, val, is_read_pct, is_reading_str, no_page_read_str): try: test_val = int(is_read_pct) except: return 'is_read_pct is not a number' import re mg = re.match('.*\s(\d+[-/]\d+[-/]\d+).*?Last Page Read: Location \d+ \((\d+)%\)', val, re.I + re.DOTALL); if mg is None: return no_page_read_str date = mg.group(1) pct = mg.group(2) try: f = int(pct) if f > test_val: return date elif f > 0: return is_reading_str + ': ' + pct + '%' except: pass return no_page_read_str Code:
{comments:kindle_read_status(95,Reading,Not Read)} Cheers |
04-06-2011, 08:57 AM | #19 |
Addict
Posts: 385
Karma: 6514
Join Date: Aug 2010
Location: Denmark
Device: Kindle 3 3G+Wifi, Oasis
|
Hi
Some things changed since your own post #8 in this thread https://www.mobileread.com/forums/sho...71&postcount=8 It appears you have the code from #137 and had arg count from post #172 in the old thread. The code from #137 will return the date, if you want the Text Read returned, follow instructions in #172. |
11-14-2014, 07:40 PM | #20 | |
Junior Member
Posts: 8
Karma: 10
Join Date: Nov 2014
Location: Germany
Device: KPW2
|
Hi,
I have the same problem as PapaJohn. I'm already trying to get the read status in my Calibre for days now. I have, as described, deleted and tried again many times, waited a day and always rebooted Calibre and it is still displaying "not read". What am I doing wrong? Does it work at all with the KPW2 I use the template kindle_read_status_2 with German text. Kindle PW2 - Calibre 2.10 - OS X 10.9.5 Quote:
|
|
Advert | |
|
12-15-2014, 02:17 PM | #21 |
Enthusiast
Posts: 35
Karma: 10
Join Date: Feb 2011
Device: Kindle Paperwhite, Kobo Aura One
|
Hi pein2k4,
This is what I have in my template: (it is working fine for my Kindle DX and my wife's Paper White under Calibre 2.12.0) Function: kindle_read_status Arg Count: 5 Documentation: Check if the associated field contains a kindle annotation for percent read. If not, return no_page_read_str. If so, then compare that percent against is_read_pct. If the val is larger, then return is_read_str, if the val is >0 and < is_read_pct return is_reading_str. Otherwise return is_not_read_str. One usage: {comments:kindle_read_status(90,Read,Reading,Not Read)} ( use the above when defining your custom column ) 90 goes into variable is_read_pct. IF pct_read > 90 the book is "read" The text returned is Read goes into the variable is_read_str. This ex. returns the text Read Reading goes into variable is_reading_str. IF pct_read >0 book the text "Reading" is shown with the percentage shown as well. Not Read goes into variable no_page_read_str. IF none of the above catch, then "Not Read" is shown. Feel free to change the %, the text strings to suit your needs. Remember: Do this in the custom column definition. Program Code: Code:
def evaluate(self, formatter, kwargs, mi, locals, val, is_read_pct, is_read_str, is_reading_str, no_page_read_str): try: test_val = int(is_read_pct) except: return 'is_read_pct is not a number' import re mg = re.match('.*\s(\d+[-/]\d+[-/]\d+).*?Last Page Read: Location \d+ \((\d+)%\)', val, re.I + re.DOTALL); if mg is None: return no_page_read_str date = mg.group(1) pct = mg.group(2) try: f = int(pct) if f > test_val: return is_read_str elif f > 0: return is_reading_str + ': ' + pct + '%' except: pass return no_page_read_str Good Luck Ps: Don't forget to select Fetch Annotations fron the menu once your device is connected to Calibre. Last edited by chaley; 02-14-2015 at 06:43 AM. Reason: Add code tags so the the necessary indentation is preserved |
02-13-2015, 08:00 PM | #22 |
Enthusiast
Posts: 40
Karma: 3798
Join Date: Nov 2014
Location: Adelaide, Australia
Device: Kobo Forma
|
I have used the exact code in the previous post but all I get is "Not Read" - am using a PW2.
|
03-14-2015, 10:27 PM | #23 |
Junior Member
Posts: 5
Karma: 10
Join Date: Feb 2012
Device: Kindle 4
|
Same issues here, my old read status for the german kindle (posted here) no longer work with my PW1.
Any ideas to fix this? Why will the Annotations not be shown? |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Need help with this custom Column. | Rie142 | Library Management | 2 | 02-20-2011 09:51 AM |
Custom Composite Column | silentguy | Calibre | 4 | 11-24-2010 10:28 AM |
Custom column read ? | pchrist7 | Calibre | 2 | 10-04-2010 02:52 AM |
custom column i need a little help | shinken | Calibre | 3 | 09-15-2010 03:41 AM |
Custom Column Problem | MSJim | Calibre | 7 | 09-08-2010 05:07 PM |