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.
5) In der Program Code Box folgendes einfügen:
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
6) erst Erstellen drücken, und dann Anwenden Button klicken
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)}
10) OK und dann Anwenden klicken.
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.
5) In der Program Code Box folgendes einfügen:
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
6) erst Erstellen drücken, und dann Anwenden Button klicken
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)}
10) OK und dann Anwenden klicken.
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