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

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 08-11-2011, 08:18 AM   #241
chaley
"chaley", not "charley"
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 5,059
Karma: 802238
Join Date: Jan 2010
Location: France
Device: Many android devices
Quote:
Originally Posted by kjtaylor13 View Post
Does anyone have any idea where I'm going wrong. I've tried restarting Calibre and trying again and still get the same issues. I've also checked I'm on the latest version of calibre and I am.
You (probably) aren't doing anything wrong. I broke template function definition in the latest release. It will be fixed in the next release, probably tomorrow.
chaley is offline   Reply With Quote
Old 08-11-2011, 09:03 AM   #242
kjtaylor13
Junior Member
kjtaylor13 began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Aug 2011
Device: kKindle 3 / Sony PRS 500
Hi,

Thanks for your quick response, I will keep an eye out for the next update.

Many Thanks for your work on a Great Application.
kjtaylor13 is offline   Reply With Quote
Old 01-26-2012, 12:53 PM   #243
razorsoup
Member
razorsoup began at the beginning.
 
Posts: 21
Karma: 10
Join Date: Jan 2012
Device: Kindle 4
Kindle Read Status

I am following this post by pchrist7 to add a read status column to Calibre. I would like to pad the percentages with spaces on the left to aid in sorting but cannot figure out how to do so. I have tried changing the line to
Code:
return is_reading_str + ': ' + pct.rjust(3) + '%'
and
Code:
return is_reading_str + ': ' + pct.rjust(3, ' ') + '%'
but neither of these seem to work. If I use
Code:
return is_reading_str + ': ' + pct.rjust(3, '0') + '%'
the percentage is padded with zeros, so the padding seems to work. I guess something is stripping the extra spaces? Is there any way to do what I am trying?

Original post by pchrist7:
Spoiler:
Quote:
Originally Posted by pchrist7 View Post
Hi Again
No problem
This helps ME to expand my knowledge, when time & energy allows.
( had weird brain farts over this simple change. Not my day ?)

OK - IF I have understood your request correctly, I suggest you create a new python template function, and a new custom column. Then You don't loose what you have.

Follow the instruction in the original post, BUT change the step instructions with the ones listed below !!!

The link to the original instructions:
http://www.mobileread.com/forums/sho...31#post1353631

Replace the Original instruction step # with the following:

step 2: kindle_read_status_2

step 3: 5

step 4:
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.
step 5:
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
step 9:
Lookup name: read_status2
Column Heading: Read Status2
Column type: Column built from other columns
Template:
Code:
{comments:kindle_read_status_2(90,Read,Reading,Not Read)}
REMEMBER to to do steps 10 to 13 !!
Or this won't work

IF this doesn't work, please try to delete the NEW costum column, and the NEW python template. Restart Calibre and try once more.

Hope this helps you with wishes. And it ain't even Xmas for quite a while
razorsoup is offline   Reply With Quote
Old 02-14-2012, 05:00 PM   #244
FMarkus
Junior Member
FMarkus began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Feb 2012
Device: Kindle 4
Hello,
I received a new Kindle 4 today and I want to try the plugboard function in calibre to rename and sort some ebooks but for gods sake it did not work.

I use following Template: {series}{series_index:0>2s| [|] }{title}
After I send an eBook to the Kindle the filename on the device is changed but the title is still the same as in Calibre. Please see pictures attached.

*UPDATE*

Now it works! I don't know why, but now all titles on the Kindle are renamed.
Attached Thumbnails
Click image for larger version

Name:	pic1.jpg
Views:	96
Size:	107.2 KB
ID:	82575   Click image for larger version

Name:	pic2.jpg
Views:	83
Size:	35.6 KB
ID:	82576   Click image for larger version

Name:	pic3.jpg
Views:	79
Size:	63.4 KB
ID:	82577   Click image for larger version

Name:	pic1_2.jpg
Views:	78
Size:	205.3 KB
ID:	82578  

Last edited by FMarkus; 02-14-2012 at 05:21 PM.
FMarkus is offline   Reply With Quote
Old 02-15-2012, 05:55 AM   #245
Ptarmigan
Junior Member
Ptarmigan began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Feb 2012
Device: Kindle
I had the same problem, but found the answer somewhere on these boards (sorry, can't find the post now).

If the files were originally on the Kindle under their old title, you need to not only delete them from the Kindle but restart it (Menu > Settings > Menu > Restart on mine), then send the new versions from Calibre (Send to Device). Apparently the Kindle can be a bit reluctant to let go of stored metadata.
Ptarmigan is offline   Reply With Quote
Old 02-15-2012, 11:10 AM   #246
kintrupf
Junior Member
kintrupf began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Jan 2012
Device: Sony PRS-T1
Custom column to display book size in KByte?

Is it possible to create a custom column that displays the book size in KByte? The default size display in MByte is rather 'course'...

Last edited by kintrupf; 02-15-2012 at 11:25 AM.
kintrupf is offline   Reply With Quote
Old 02-15-2012, 11:56 AM   #247
chaley
"chaley", not "charley"
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 5,059
Karma: 802238
Join Date: Jan 2010
Location: France
Device: Many android devices
Quote:
Originally Posted by kintrupf View Post
Is it possible to create a custom column that displays the book size in KByte? The default size display in MByte is rather 'course'...
Use this template in a "column built from other columns".
Code:
program: human_readable(booksize())
The documentation for both functions is at http://manual.calibre-ebook.com/temp...man-readable-v. The documentation for general program mode templates (those that begin with program is at http://manual.calibre-ebook.com/temp...l-program-mode
chaley is offline   Reply With Quote
Old 02-15-2012, 12:08 PM   #248
theducks
Grand Sorcerer
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 14,282
Karma: 5495472
Join Date: Aug 2009
Location: The (original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
Quote:
Originally Posted by kintrupf View Post
Is it possible to create a custom column that displays the book size in KByte? The default size display in MByte is rather 'course'...
IMHO Count Pages (plugin) value is a better measure on the size of a book.
Images add bytes.
Mark up (HTML Tags) adds bytes

So unless you are storage oriented, bytes is not the most useful of measures
theducks is offline   Reply With Quote
Old 02-18-2012, 05:29 AM   #249
FMarkus
Junior Member
FMarkus began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Feb 2012
Device: Kindle 4
Hello,
I have an issue with the read status in calibre.
I use a Kindle4 and installed the python script and added the column as described in the post from pchrist7. (I uses the kindle_read_status_2)

The reading status is shown in the Meta Preview (pic1) but the custom column only shows not read (pic2).

I used following template for the column:
{comments:kindle_read_status_2(90,Read,Reading,Not Read)}

For my understanding the custom column must show read (or the %) but it shows only Not Read

Edit:
Could it be possible that the python script only checks the english version?
What needs to be changed to match the german language? (17.02.2012
Zuletzt gelesene Seite: Ort 3051 (99%)
Attached Thumbnails
Click image for larger version

Name:	pic1.jpg
Views:	74
Size:	208.4 KB
ID:	82704   Click image for larger version

Name:	pic2.jpg
Views:	59
Size:	9.4 KB
ID:	82705  

Last edited by FMarkus; 02-18-2012 at 09:17 AM.
FMarkus is offline   Reply With Quote
Old 02-19-2012, 02:13 AM   #250
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
German version - kindle_read_status_2

Quote:
Originally Posted by FMarkus View Post
Hello,
I have an issue with the read status in calibre.
I use a Kindle4 and installed the python script and added the column as described in the post from pchrist7. (I uses the kindle_read_status_2)

The reading status is shown in the Meta Preview (pic1) but the custom column only shows not read (pic2).

I used following template for the column:
{comments:kindle_read_status_2(90,Read,Reading,Not Read)}

For my understanding the custom column must show read (or the %) but it shows only Not Read

Edit:
Could it be possible that the python script only checks the english version?
What needs to be changed to match the german language? (17.02.2012
Zuletzt gelesene Seite: Ort 3051 (99%)
Hi Markus
Yes, the examples only works for english status text.
However, here's a German version that should work, at least it does here, using your example. You'll have to modify the template.
Make a copy of the line mg = rematch etc., and insert it below the original line.
Disable the original by entering a # sign at the front
Modify the copy line (or copy from the code below) to handle german text.
Please be carefull you have a TAB in front of the copy line.

Code:
#	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);
Edit: Remember to restart Calibre
Hope this works for you,
Cheers Per

Last edited by pchrist7; 02-19-2012 at 02:17 AM. Reason: typos
pchrist7 is offline   Reply With Quote
Old 02-19-2012, 02:27 AM   #251
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
Because pct is an integer ?

Quote:
Originally Posted by razorsoup View Post
I am following this post by pchrist7 to add a read status column to Calibre. I would like to pad the percentages with spaces on the left to aid in sorting but cannot figure out how to do so. I have tried changing the line to
Code:
return is_reading_str + ': ' + pct.rjust(3) + '%'
and
Code:
return is_reading_str + ': ' + pct.rjust(3, ' ') + '%'
but neither of these seem to work. If I use
Code:
return is_reading_str + ': ' + pct.rjust(3, '0') + '%'
the percentage is padded with zeros, so the padding seems to work. I guess something is stripping the extra spaces? Is there any way to do what I am trying?

Original post by pchrist7:
Spoiler:

Hi razorsoup
I'm not that much of a python programmer, but I suspect python only let's you use 0 padding since pct is an integer and rjust is a string function ?
If that's the way it works, you could try to convert pct from int to string before using rjust. Sorry, don't know how to do this. Google might help you.
If you figure it out, please enlighten us all in this thread
Cheers, Per
pchrist7 is offline   Reply With Quote
Old 02-19-2012, 03:50 AM   #252
FMarkus
Junior Member
FMarkus began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Feb 2012
Device: Kindle 4
Quote:
Originally Posted by pchrist7 View Post
Hi Markus
Yes, the examples only works for english status text.
However, here's a German version that should work, at least it does here, using your example. You'll have to modify the template.
Make a copy of the line mg = rematch etc., and insert it below the original line.
Disable the original by entering a # sign at the front
Modify the copy line (or copy from the code below) to handle german text.
Please be carefull you have a TAB in front of the copy line.

Code:
#	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);
Edit: Remember to restart Calibre
Hope this works for you,
Cheers Per
Thanks for your help, now it works.

Another question, any idea how to hide the .mbp file in the format column?

Hopefully it was ok to post a german translation in the german Sub Forum -> Link

Last edited by FMarkus; 02-19-2012 at 04:46 AM.
FMarkus is offline   Reply With Quote
Old 02-23-2012, 09:50 AM   #253
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
Thumbs up Good initiative

Quote:
Originally Posted by FMarkus View Post
Thanks for your help, now it works.

Hopefully it was ok to post a german translation in the german Sub Forum -> Link
Hi FMarkus
Glad to hear it works.
I have NO problem what so ever, that you've translated, and posted in the German forum.
Actually, I think it's brilliant !

cheers, Per
pchrist7 is offline   Reply With Quote
Old 03-01-2012, 08:25 PM   #254
razorsoup
Member
razorsoup began at the beginning.
 
Posts: 21
Karma: 10
Join Date: Jan 2012
Device: Kindle 4
Quote:
Originally Posted by pchrist7 View Post
Hi razorsoup
I'm not that much of a python programmer, but I suspect python only let's you use 0 padding since pct is an integer and rjust is a string function ?
If that's the way it works, you could try to convert pct from int to string before using rjust. Sorry, don't know how to do this. Google might help you.
If you figure it out, please enlighten us all in this thread
Cheers, Per
I tried converting to a string (I think, I also am not a python programmer) but that didn't work either. Thanks for your help anyways.
razorsoup is offline   Reply With Quote
Old 03-27-2012, 10:15 AM   #255
emellaich
Wizard
emellaich ought to be getting tired of karma fortunes by now.emellaich ought to be getting tired of karma fortunes by now.emellaich ought to be getting tired of karma fortunes by now.emellaich ought to be getting tired of karma fortunes by now.emellaich ought to be getting tired of karma fortunes by now.emellaich ought to be getting tired of karma fortunes by now.emellaich ought to be getting tired of karma fortunes by now.emellaich ought to be getting tired of karma fortunes by now.emellaich ought to be getting tired of karma fortunes by now.emellaich ought to be getting tired of karma fortunes by now.emellaich ought to be getting tired of karma fortunes by now.
 
Posts: 1,018
Karma: 3630887
Join Date: Oct 2007
Device: Palm=> Ebookman=> IPaq=> Axim=> Cybook=> Kindle 2=>IPAD 1 & Kindle 3SO
Sorry, for such a basic question, but I'm still trying to educate myself on what plugboards do. I didn't see (understand?) this in the previous postings.

I want to be able to add the series name/number to my title in my Calibre collection. As I understand it, plugboards are only activated when you save to disk or send to device. Is there a way to select a batch of books, and apply a plugboard or template to change only those books in Calibre? Of course, I wouldn't want it reapplied then when I send it to device.

Any thoughts?
emellaich is offline   Reply With Quote
Reply

Tags
custom column

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
custom column i need a little help shinken Calibre 3 09-15-2010 03:41 AM
Using Custom Metadata in Save Template EJvdH Calibre 1 07-02-2010 06:06 AM
Accessories Decalgirl Kindle 2 custom skin template srmalloy Amazon Kindle 6 04-09-2010 09:55 PM
Donations for Custom Recipes ddavtian Calibre 5 01-23-2010 04:54 PM
Help understanding custom recipes andersent Calibre 0 12-17-2009 02:37 PM


All times are GMT -4. The time now is 10:01 PM.


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