On Jun 20, "H. Turgut Uyar" <[EMAIL PROTECTED]> wrote:

> I tried to be as unintrusive as possible. Beside adding the 
> beautifulsoup xpath module only few things are modified in the 
> parserbase and searchmovieparser classes.

I'm more and more impressed. :-)
I really hope we don't hit some show-stopper problem, in the future:
this approach is almost amazing.
If I understand correctly, all that is needed to parse search results,
are the feed_dom method and the entries in the _k dictionary.

The first thing, is to decide the overall structure for the parsers.
I think it's better to separate it from the ParserBase class, and
move the "engine" of the new parser in another class (or something).
Once a replacement is written, the old code can be removed altogether
(or temporarily leaved in place for tests).

The requirements are the same:
- process transparently the names/titlesRefs (I can add it later,
  there is no need to write the code right now; it's enough if it
  can be added easily)
- get a unicode [1] string at input, parse it according to some rules
  (the ones defined in the feed_dom method, actually) and return
  a set of dictionary with the data and names/titlesRefs.

In your opinion what's the best design?  A complete replica of
the actual ParserBase class, leaving to the feed_dom of the subclasses
the parsing work?
I'm sure that some (many?) complex parser will require some (a lot
of?) code to be written, but there are also many simpler code.
Do you think these can be handled by a generic "feed_dom" code,
using a set of provided parameters (like the one you've put in
the _k dictionary of the HTMLSearchMovieParser class)?

By the way: I think it's time to give up to the _ModuleProxy approach:
let's leave it in place to be used by ParserBase-based parsers, but
it was just a bad idea.

Actually I'm studing the bases of XPath: once a stable design is in
place, I hope I'll be ready to start writing some parsers.


Thanks!

+++
[1] so far I won't touch the IMDbURLopener, even if it's guessing
    for encodings can be handled better by BeautifoulSoup and friends.
-- 
Davide Alberani <[EMAIL PROTECTED]> [PGP KeyID: 0x465BFD47]
http://erlug.linux.it/~da/

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Imdbpy-devel mailing list
Imdbpy-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/imdbpy-devel

Reply via email to