![]() |
#1 |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Feb 2012
Device: Kindle 4
|
Calibre Read status vom Kindle auslesen
Die ganze Idee und Umsetzung stammt nicht von mir sondern ist hier im Original zu finden ->
Reading/read status custom column (Kindle) (pchrist7, w/ideas from beckywc): Extract reading/read status from kindle annotations and show them in a custom column. See this post for details and instructions.. Das ist nur eine Übersetzung für den Deutschen Kindle. Methode 1: 1) Einstellungen -> Funktionen für Vorlagen 2) Im Funktions Feld folgendes eingeben: kindle_read_status 3) Im Arg count Feld: 4 4) In der Dokumentation Box folgendes einfügen: Code:
Check if the associated field contains a kindle annotation for percent read. If not, return no_page_read_str. If annotations are found, then compare that percent against is_read_pct. If the val is larger, then return date, 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(95,Not Read,Reading)} ( use the above when defining your custom column ) 95 goes into variable is_read_pct Not Read goes into variable no_page_read_str Reading goes into variable is_reading_str Feel free to change the %, the test strings to suit your needs. Do this in the custom column definition. 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); mg = re.match('.*\s(\d+[-/\.]\d+[-/\.]\d+).*?Zuletzt gelesene Seite: Ort \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 7) Danach auf Eigene Spalte hinzufügen 8) Auf Benutzdefinierte Spalte hinzufügen klicken 9) Folgende Eingaben machen Suchname: read_status Spaltenüberschrift: Read Status Spaltentyp: Aus anderen Spalten zusammengesetzte Spalte Vorlage: Code: Code:
{comments:kindle_read_status(95,Reading,Not Read)} 11) Dann Calibre neustarten 12) Die Lesedaten ruft man ab indem man auf "An Reader übertragen" rechtsklickt und Anmerkungen abrufen auswählt __________________________________________________ __________________________________________________ _________________________________________________ Methode 2 Step 2: Im Funktions Feld folgendes eingeben: kindle_read_status_2 3) Im Arg count Feld: 5 4) In der Dokumentation Box folgendes einfügen: Code:
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. 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); mg = re.match('.*\s(\d+[-/\.]\d+[-/\.]\d+).*?Zuletzt gelesene Seite: Ort \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 7) Danach auf Eigene Spalte hinzufügen 8) Auf Benutzdefinierte Spalte hinzufügen klicken 9) Folgende Eingaben machen Suchname: read_status2 Spaltenüberschrift: Read Status2 Spaltentyp: Aus anderen Spalten zusammengesetzte Spalte Vorlage: Code: Code:
{comments:kindle_read_status_2(90,Read,Reading,Not Read)} 11) Dann Calibre neustarten 12) Die Lesedaten ruft man ab indem man auf "An Reader übertragen" rechtsklickt und Anmerkungen abrufen auswählt __________________________________________________ __________________________________________________ ________________________ Meine eigene Spalte habe ich so formatiert: Code:
{comments:kindle_read_status(98,am lesen,Nicht Gelesen Last edited by FMarkus; 02-19-2012 at 04:53 AM. |
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Custom Read Status Column | PapaJohn | Devices | 23 | 05-22-2015 04:57 AM |
catalog not displaying read status correctly | alansplace | Calibre | 0 | 08-05-2011 01:35 AM |
Calibre 0.8.12 Overwrites 'Im_Reading' and 'Read' Status on original Kobo | GMFuller | Devices | 4 | 07-31-2011 02:12 AM |
Newest Calibre not working for editing Read status on Kobo | likeadeadstar | Devices | 10 | 07-22-2011 01:36 AM |
LEARNER - Home - Work . . . Same forums... Different Read status. | wannabee | General Discussions | 1 | 11-09-2010 01:59 PM |