Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Devices

Notices

Reply
 
Thread Tools Search this Thread
Old 04-02-2011, 11:02 PM   #16
PapaJohn
Member
PapaJohn began at the beginning.
 
Posts: 17
Karma: 10
Join Date: Feb 2011
Device: Kindle DX
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???
PapaJohn is offline   Reply With Quote
Old 04-03-2011, 02:10 AM   #17
pchrist7
Addict
pchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animals
 
pchrist7's Avatar
 
Posts: 385
Karma: 6514
Join Date: Aug 2010
Location: Denmark
Device: Kindle 3 3G+Wifi
Quote:
Originally Posted by PapaJohn View Post
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?
Will test based on your original example. Please post new example of annotation, column definition incl. python template, just in case you changed something.

Quote:
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???
As said before, Calibre stores 1 set of annotations for 1 book. It's book based, not device based. IF you want to track read status of 1 book, on 2 devices, you should have 2 Calibre libraries: 1 for KDX and 1 for K3.
I might be wrong, but I think not.
Developpers ?

Last edited by pchrist7; 04-03-2011 at 02:12 AM. Reason: spelling, formats
pchrist7 is offline   Reply With Quote
Old 04-05-2011, 06:32 PM   #18
PapaJohn
Member
PapaJohn began at the beginning.
 
Posts: 17
Karma: 10
Join Date: Feb 2011
Device: Kindle DX
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
And the template for the Read Status Column:
Code:
{comments:kindle_read_status(95,Reading,Not Read)}
I don't recall making any changes.
Cheers
PapaJohn is offline   Reply With Quote
Old 04-06-2011, 09:57 AM   #19
pchrist7
Addict
pchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animals
 
pchrist7's Avatar
 
Posts: 385
Karma: 6514
Join Date: Aug 2010
Location: Denmark
Device: Kindle 3 3G+Wifi
Quote:
Originally Posted by PapaJohn View Post
Hi pchrist7
I don't recall making any changes.
Cheers
Hi
Some things changed since your own post #8 in this thread
http://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.
pchrist7 is offline   Reply With Quote
Old 11-14-2014, 08:40 PM   #20
pein2k4
Junior Member
pein2k4 began at the beginning.
 
Posts: 2
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:
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+).*?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
pls
pein2k4 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help with this custom Column. Rie142 Library Management 2 02-20-2011 10:51 AM
Custom Composite Column silentguy Calibre 4 11-24-2010 11:28 AM
Custom column read ? pchrist7 Calibre 2 10-04-2010 03:52 AM
custom column i need a little help shinken Calibre 3 09-15-2010 04:41 AM
Custom Column Problem MSJim Calibre 7 09-08-2010 06:07 PM


All times are GMT -4. The time now is 05:16 PM.


MobileRead.com is a privately owned, operated and funded community.