Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 03-03-2011, 02:17 AM   #46
ldolse
Wizard
ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.
 
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
It wasn't something I was figuring would be ready immediately anyway, still a fair bit of cleanup to do.

I noticed you're making progress in trunk on the metadata infrastructure modifications, one of my next steps was to figure out how to tie this in with the generic identifiers you've just added to trunk - I assume this was the field you were planning to use for ASIN, ReserveID, and other platform specific identifiers.
ldolse is offline   Reply With Quote
Old 03-03-2011, 10:01 AM   #47
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by ldolse View Post
apparently this website is fairly unique in it's ability to trip up mechanize, because none delete cookies or manipulate them the way I'm trying to do.
I've been reading your posts, and what you were doing didn't quite seem to match up with what I'd seen done in the recipe code. That's why I started with "I don't know if you will find it to be of any value." Still, I thought there might be something there you could use.
Starson17 is offline   Reply With Quote
Advert
Old 03-03-2011, 10:30 AM   #48
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Yes, the identifiers table will be used for all identifiers in the future, including ISBN
kovidgoyal is offline   Reply With Quote
Old 03-06-2011, 06:06 AM   #49
ldolse
Wizard
ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.
 
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
I started looking at tying in the title/author cleanup functions we discussed earlier - I don't see how to import those functions while metadata.sources.base isn't actually integrated into the codebase. Tried creating a separate class just to call the generic functions in the plugin, but it wants a variable set of arguments to initialize the Source() class that have nothing to do with just passing title/author over for cleanup, and seem to only be setup to be passed from metadata.sources.test at the present time...

Is there a quick and dirty way to just get those functions imported to my plugin, or do I need to duplicate the code until the new framework is ready? ( I suppose another option might be to move them outside of the class definition in metadata.sources.base)
ldolse is offline   Reply With Quote
Old 03-06-2011, 09:48 AM   #50
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
from calibre.ebooks.metadata.sources.base import MetadataSource

s = MetadataSource(None)

Now just use the methods of s like you would any other class
kovidgoyal is offline   Reply With Quote
Advert
Old 03-06-2011, 01:08 PM   #51
ldolse
Wizard
ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.
 
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
Didn't realize it was as easy as passing 'None' - very cool.

I just started playing with the functions - I notice they strip periods from authors/titlenames - was this done because periods specifically misbehave with some services? I would think that most services should be able to handle them, and in some cases expect them - Overdrive seemed to expect them as an example - the search returned no results when they were stripped.

I don't feel particularly strongly either way with regard to stripping/them them, just curious. I'm thinking maybe the best approach would be to trust the original input at first, and only try normalizing it if there's a failure/lack of returned results.
ldolse is offline   Reply With Quote
Old 03-06-2011, 01:11 PM   #52
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
I don't feel particularly strongly either way with regard to stripping/them them, just curious. I'm thinking maybe the best approach would be to trust the original input at first, and only try normalizing it if there's a failure/lack of returned results.
That would be slow. Are you saying overdrive needs periods in the title or in the author tokens? You can change it to strip trailing periods, instead. That should take care of it.
kovidgoyal is offline   Reply With Quote
Old 03-06-2011, 01:18 PM   #53
ldolse
Wizard
ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.
 
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
Overdrive needs periods in author initials.

J. R. R. Tolkien returns results.

J R R Tolkien returns nothing.

I'll change it to remove trailing periods, that will probably be fine - will test some 'Jr.' examples to see if that makes difference, but common abbreviations are probably something that makes sense to strip from the list of tokens anyway.
ldolse is offline   Reply With Quote
Old 03-06-2011, 01:45 PM   #54
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Wait, IIRC the current code remove initials so an author value of J. R. R. Tolkien will return only the token "Tolkien"
kovidgoyal is offline   Reply With Quote
Old 03-06-2011, 02:22 PM   #55
ldolse
Wizard
ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.
 
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
It didn't do that - I had it printing out debug statements to see exactly how it cleansed it - it created an iterable something along the lines of [J, R, R, Tolkien].

I can definitely get in line with Stripping out single character initials completely if you want I'll include that in the other modifications - that would help for the cases where an AND search gets tripped up because it expects 'J.R.R.' vs. 'J. R. R.'
ldolse is offline   Reply With Quote
Old 03-06-2011, 02:29 PM   #56
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Are you sure you're runinng from updated source, the relevant lines are

Code:
                    if len(tok) > 2 and tok.lower() not in ('von', ):
                        yield tok
Then length check means initials and most connectives are stripped out.
kovidgoyal is offline   Reply With Quote
Old 03-06-2011, 02:40 PM   #57
ldolse
Wizard
ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.
 
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
Apparently it's not working - those lines are in my code, but here's the debug output I created which parses the iterable returned by get_author_tokens and then builds the query string:

author token is: J
author token is: R
author token is: R
author token is: Tolkien
final author query string is J+R+R+Tolkien

I haven't done any debugging of the function itself, was just getting it hooked into the plugin thus far.
ldolse is offline   Reply With Quote
Old 03-06-2011, 02:47 PM   #58
ldolse
Wizard
ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.
 
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
Is there any reason print statements won't work from inside ebooks.metadata.sources.base? Just added some to see what was going on and I'm not getting any output...
ldolse is offline   Reply With Quote
Old 03-06-2011, 02:56 PM   #59
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Make sure you are starting calibre as

calibre-debug -g

Other than that, there should be no problems.
kovidgoyal is offline   Reply With Quote
Old 03-06-2011, 03:10 PM   #60
ldolse
Wizard
ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.
 
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
I'm not calling it from the GUI, calling the plugin directly from the CLI:
calibre-debug -e ./src/calibre/ebooks/metadata/overdrive.py

Print statements in the plugin are showing up fine, the ones added to the get_author_tokens function in ebooks.metadata.sources.base are the ones that aren't showing up for me...

Wasn't sure if it had something to do with passing 'None' as the only argument when referencing the class.
ldolse is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Covers Plugin] Goodreads Covers **Deprecated** kiwidude Plugins 13 04-17-2011 05:09 PM
Is all Overdrive the same? CWatkinsNash General Discussions 3 12-28-2010 04:01 PM
Covers, covers and damn statistics (wait, I got that wrong). Moejoe Writers' Corner 86 11-29-2010 08:34 PM
Stop Using Overdrive Fat Abe General Discussions 19 09-11-2010 08:30 PM
Overdrive Overseas Honch Which one should I buy? 3 12-08-2009 08:21 AM


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


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