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

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 01-03-2011, 10:37 AM   #1
dasimser
Member
dasimser began at the beginning.
 
Posts: 18
Karma: 46
Join Date: Dec 2008
Location: Ottawa, ON, Canada
Device: Kobo Aura
Tag Browser partitioning

Hi,

I really like the new (and improved now that it works properly ) tag browser partitioning in 0.7.37! Thanks for the rapid feature development and even faster support!

I was playing with the tweaks trying to get my author name partitions to show lastname1 - lastname2 instead of just the first 4 characters. It would seem to be pretty simple to do (i.e., extract everything up to the comma or newline from author_sort), but it appears to be beyond my skills of using the template language and regexps.

Could one of you kind souls take pitty on me and let me know how to configure the tweaks to accomplish this?

Thanks,

Dave.
dasimser is offline   Reply With Quote
Old 01-03-2011, 11:50 AM   #2
chaley
Grand Sorcerer
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: 11,691
Karma: 6240117
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Try
Code:
categories_collapsed_name_template = r'{first.sort:re((.*?)(\,|$).*,\1)} - {last.sort:re((.*?)(\,|$).*,\1)}'
Beyond the re itself, the trick here (one that I had forgotten about) is the "r" in front of the quote. That tells python to not process any of the backslashes in the string. Without the r, the backslashed characters get converted to something else.

I think I will change the tweak so that the 'r' is there by default.
chaley is offline   Reply With Quote
Advert
Old 01-03-2011, 12:18 PM   #3
dasimser
Member
dasimser began at the beginning.
 
Posts: 18
Karma: 46
Join Date: Dec 2008
Location: Ottawa, ON, Canada
Device: Kobo Aura
Perfect! That did the trick.

Thanks for the help (and for the feature, for that matter )

Dave.
dasimser 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
Tag Browser & Series oldbwl Calibre 7 10-06-2010 04:58 PM
Creating a Short Text Column that Doesn't Appear in Tag Browser? shocampo Calibre 2 09-12-2010 01:35 PM
Empty tag browser Rachel Calibre 18 07-26-2010 11:42 AM
Tag Browser - grayed out tags? Starson17 Calibre 1 07-25-2010 12:16 PM
Tag Browser not updating when switching between libraries. DoctorOhh Calibre 2 06-06-2010 12:22 AM


All times are GMT -4. The time now is 03:59 AM.


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