Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 01-26-2011, 03:07 PM   #166
nynaevelan
eBook Junkie
nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.
 
nynaevelan's Avatar
 
Posts: 1,526
Karma: 1464018
Join Date: May 2010
Location: USA
Device: Kindle Fire 2020, Kindle PW2
I have actually seen a few 100% but it is not the percentages I am concerned with. I am actually concerned with the reading. For instance if the percentage is 90 or higher I would like it to say Read not Reading.
nynaevelan is offline   Reply With Quote
Old 01-26-2011, 10:21 PM   #167
anesthezea
Groupie
anesthezea ought to be getting tired of karma fortunes by now.anesthezea ought to be getting tired of karma fortunes by now.anesthezea ought to be getting tired of karma fortunes by now.anesthezea ought to be getting tired of karma fortunes by now.anesthezea ought to be getting tired of karma fortunes by now.anesthezea ought to be getting tired of karma fortunes by now.anesthezea ought to be getting tired of karma fortunes by now.anesthezea ought to be getting tired of karma fortunes by now.anesthezea ought to be getting tired of karma fortunes by now.anesthezea ought to be getting tired of karma fortunes by now.anesthezea ought to be getting tired of karma fortunes by now.
 
anesthezea's Avatar
 
Posts: 167
Karma: 2627964
Join Date: Aug 2010
Location: Alabama, USA
Device: Kobo Libra 2, Kobo Clara 2e, Kobo Libra Colour, Kindle Paperwhite
I've just recently begun using plugboards and have been trying to help a friend set them up as well. She has a particular way she likes her books to show up and I'm wondering if there is a way to edit the plugboard to reflect something similar.

My friend prefers her books to be sorted by series but look like this:



Would something like this work?

{title} - (#{series_index:0>2s| - | - })
anesthezea is offline   Reply With Quote
Advert
Old 01-26-2011, 10:35 PM   #168
theducks
Well trained by Cats
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: 30,439
Karma: 58055868
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by anesthezea View Post
I've just recently begun using plugboards and have been trying to help a friend set them up as well. She has a particular way she likes her books to show up and I'm wondering if there is a way to edit the plugboard to reflect something similar.

My friend prefers her books to be sorted by series but look like this:



Would something like this work?

{title} - (#{series_index:0>2s| - | - })
I see a few problems
1) there is No series, only a place (series_index)number in some (unknown) series

2) Depending on how your reader sorts (alpha-numeric is common), that list would tend to sort based upon the First letter (B, C, I, J, L, Po, Pu, R, S, W)

Possibly, you want a Series folder/
The 2 digits of a Series Index (so 01, 02, 10 not 1, 10, 2,...)
Then the title (having author before the relevant info may mess the sort if multiple, different authors in a series
theducks is offline   Reply With Quote
Old 01-26-2011, 11:08 PM   #169
anesthezea
Groupie
anesthezea ought to be getting tired of karma fortunes by now.anesthezea ought to be getting tired of karma fortunes by now.anesthezea ought to be getting tired of karma fortunes by now.anesthezea ought to be getting tired of karma fortunes by now.anesthezea ought to be getting tired of karma fortunes by now.anesthezea ought to be getting tired of karma fortunes by now.anesthezea ought to be getting tired of karma fortunes by now.anesthezea ought to be getting tired of karma fortunes by now.anesthezea ought to be getting tired of karma fortunes by now.anesthezea ought to be getting tired of karma fortunes by now.anesthezea ought to be getting tired of karma fortunes by now.
 
anesthezea's Avatar
 
Posts: 167
Karma: 2627964
Join Date: Aug 2010
Location: Alabama, USA
Device: Kobo Libra 2, Kobo Clara 2e, Kobo Libra Colour, Kindle Paperwhite
I have a vague idea of what you are trying to tell me there. In other words, it's not going to work exactly the way she wants unless she changes her mind about how she wants her stuff to look. At the moment, she's been changing the publication dates on all of her series books so they will show up in order by series. Thanks for taking the time to help out!
anesthezea is offline   Reply With Quote
Old 01-27-2011, 05:31 AM   #170
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, Oasis
Quote:
Originally Posted by nynaevelan View Post
I have actually seen a few 100% but it is not the percentages I am concerned with. I am actually concerned with the reading. For instance if the percentage is 90 or higher I would like it to say Read not Reading.
Ah - I see
Then we need to change the python template to return "Read" instead of the date. We also need to changge the custom column definition.
Will look at it later today.
pchrist7 is offline   Reply With Quote
Advert
Old 01-27-2011, 09:46 AM   #171
nynaevelan
eBook Junkie
nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.
 
nynaevelan's Avatar
 
Posts: 1,526
Karma: 1464018
Join Date: May 2010
Location: USA
Device: Kindle Fire 2020, Kindle PW2
Quote:
Originally Posted by pchrist7 View Post
Ah - I see
Then we need to change the python template to return "Read" instead of the date. We also need to changge the custom column definition.
Will look at it later today.
Thanks for taking the time to consider this.
nynaevelan is offline   Reply With Quote
Old 01-27-2011, 11:50 AM   #172
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, Oasis
Kindle_read_status_2

Quote:
Originally Posted by nynaevelan View Post
Thanks for taking the time to consider this.
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:
https://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

Last edited by pchrist7; 04-26-2011 at 09:30 AM. Reason: Make it work for K2, KDX. Year was 4 digits and gave problems for these readers
pchrist7 is offline   Reply With Quote
Old 01-27-2011, 11:50 AM   #173
theducks
Well trained by Cats
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: 30,439
Karma: 58055868
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by anesthezea View Post
I have a vague idea of what you are trying to tell me there. In other words, it's not going to work exactly the way she wants unless she changes her mind about how she wants her stuff to look. At the moment, she's been changing the publication dates on all of her series books so they will show up in order by series. Thanks for taking the time to help out!
Your welcome
I did notice that you HAD done the 2 digit part.
The limitation may be the Reader Device, not Calibre.: Calibre will sort Series in order. I said may be, because some reader devices have other ways to present their 'bookshelf' than a the simple file name base system.

If you name the Model, someone may be able to come up with a solution for you.
theducks is offline   Reply With Quote
Old 01-27-2011, 01:30 PM   #174
nynaevelan
eBook Junkie
nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.
 
nynaevelan's Avatar
 
Posts: 1,526
Karma: 1464018
Join Date: May 2010
Location: USA
Device: Kindle Fire 2020, Kindle PW2
THANK YOU, that works perfectly, and yes it is like Christmas after Christmas.
nynaevelan is offline   Reply With Quote
Old 01-28-2011, 10:42 AM   #175
chyron8472
Groupie
chyron8472 ought to be getting tired of karma fortunes by now.chyron8472 ought to be getting tired of karma fortunes by now.chyron8472 ought to be getting tired of karma fortunes by now.chyron8472 ought to be getting tired of karma fortunes by now.chyron8472 ought to be getting tired of karma fortunes by now.chyron8472 ought to be getting tired of karma fortunes by now.chyron8472 ought to be getting tired of karma fortunes by now.chyron8472 ought to be getting tired of karma fortunes by now.chyron8472 ought to be getting tired of karma fortunes by now.chyron8472 ought to be getting tired of karma fortunes by now.chyron8472 ought to be getting tired of karma fortunes by now.
 
chyron8472's Avatar
 
Posts: 180
Karma: 558490
Join Date: Jan 2011
Device: Kindle 5, Amazon Fire 5th Gen, Moto Z Play Droid
I would like to create a plugboard that:

- Uses only the author's surname.

- Abbreviates certain series titles (ie. Lord of the Rings = LOTR)

- If the title of a book begins with "The," it is omitted (ie. The Hunger Games = Hunger Games)


how do I do that (any of it)?



edit: also, is there a possible way to return the series_index for books to correlate with the current highest value in Calibre held by the the index for that series? (ie. where Harry Potter only has 7 books, series_index is one digit, while Star Trek: New Frontier has 17 series books so its index has 2 digits) ... I suppose this would maybe be contingent on whether I had a book in a series that required multiple digits before it would change the number of leading zeroes for the other books.

This is to say, that I would like to insert the series index into my titles via a plugboard, but I want to conserve as much screen real estate as possible for the actual title, so if I didn't need leading zeroes, it wouldn't insert them.

Last edited by chyron8472; 01-28-2011 at 11:16 AM.
chyron8472 is offline   Reply With Quote
Old 01-28-2011, 11:01 AM   #176
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, Oasis
Quote:
Originally Posted by nynaevelan View Post
THANK YOU, that works perfectly, and yes it is like Christmas after Christmas.
I'm glad to hear it worked for you as expected.
Please consider giving some karma to chaley and me.
Just a thought
pchrist7 is offline   Reply With Quote
Old 01-28-2011, 12:44 PM   #177
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,216
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
Quote:
Originally Posted by chyron8472 View Post
I would like to create a plugboard that:

- Uses only the author's surname.

- Abbreviates certain series titles (ie. Lord of the Rings = LOTR)

how do I do that (any of it)?
I'm by no means an expert in templates and I'm not a Kindle user, but putting the following in your Plugboard may get you part way there:

Code:
Source template: {author_sort:re(([^\,]+)(\,|$)(.*),\1)}
Destination field: authors

Source template: {series:re(([^\s])[^\s]*(\s|$),\1)}{series_index:>2s|| - }{title}
Destination field: title
But if you have several authors called Smith, their books may be jumbled.

Last edited by jackie_w; 01-28-2011 at 12:50 PM. Reason: Caveat
jackie_w is offline   Reply With Quote
Old 01-28-2011, 01:06 PM   #178
nynaevelan
eBook Junkie
nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.
 
nynaevelan's Avatar
 
Posts: 1,526
Karma: 1464018
Join Date: May 2010
Location: USA
Device: Kindle Fire 2020, Kindle PW2
Quote:
Originally Posted by pchrist7 View Post
I'm glad to hear it worked for you as expected.
Please consider giving some karma to chaley and me.
Just a thought
Consider it done, one day I will research to figure out what this Karma stuff is about.

EDIT: I was able to add some to yours but it tells me I need to spread some reputation around before giving to Chaley again, I guess I get that message because I gave him some Karma the other day for a separate issue??

Last edited by nynaevelan; 01-28-2011 at 01:10 PM. Reason: Additional comment
nynaevelan is offline   Reply With Quote
Old 01-29-2011, 12:58 AM   #179
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, Oasis
Thank you

Quote:
Originally Posted by nynaevelan View Post
Consider it done, one day I will research to figure out what this Karma stuff is about.

EDIT: I was able to add some to yours but it tells me I need to spread some reputation around before giving to Chaley again, I guess I get that message because I gave him some Karma the other day for a separate issue??
Thank you for the Karma.
I have same problem with more karma to chaley.
Have a nice weekend,
pchrist7 is offline   Reply With Quote
Old 01-29-2011, 08:33 AM   #180
theducks
Well trained by Cats
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: 30,439
Karma: 58055868
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by nynaevelan View Post
EDIT: I was able to add some to yours but it tells me I need to spread some reputation around before giving to Chaley again, I guess I get that message because I gave him some Karma the other day for a separate issue??
You have it correct.
You have to Karma someone else, before you can give more. The longer you are here (and post), you will see the number of 'Karma' points that you can give, grow. You can adjust that number down, to just say thanks.

(I like to bonus, Polite first posters that read and followed the posting guidelines )
theducks is offline   Reply With Quote
Reply

Tags
custom column, tag, tags


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 08:09 PM.


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