On Feb 06, "H. Turgut Uyar" <u...@itu.edu.tr> wrote:

> You're right, a mixed list is probably not a good idea.

Not necessarily; in my opinion IMDbPY-based programs should not
expect to get a value of a specific type (ok, with some exceptions).

After all it's plenty of functions, in the 'helpers' module, that
can be used to pretty-print unknown set of information.

> My justification for this patch was to make navigation a little
> nicer in imdbpykit.

I know; the "problem" _may_ be fixed using the helpers.makeModCGILinks
function to create a function used to "correct" the output for some
specific strings.
The created function (used directly or passed to the imdb.IMDb instance
with the defaultModFunct parameter) will be automatically used over a
subset of strings known to contain references to Movies/Persons/Characters.

E.g. the 'plot' info of a movie can contain a reference to a Person.
But 'plot' is obviously a string.
_Internally_ IMDbPY stores the strings with references to names in
this format (for movies and charaters it's slighter different, to
distinguish the type of information):
  'Kevin Bacon' (qv)

In the movie.namesRefs dictionary of the movie for which we're printing
the above plot, there is an entry mapping 'Kevin Bacon' to a pre-built
Person instance (containing just the name and the personID).
Using the function derived from helpers.makeModCGILinks we can
convert a string _internally_ stored as:
  "...in this movie 'Kevin Bacon' (qv) plays..."

to something like:
  "...in this movie <a href="/person/personID">Kevin Bacon</a> plays..."

I _think_ it will be safe, if we create items like:
  <person id="personID">Person Name</person>

but I'm not so sure... ;-)

By the way:
- as said, for performance reasons these transformation are applied
  only to strings _known_ to have this kind of references; i.e.: 'plot'
  is in the Movie.Movie.keys_tomodify_list tuple.
- by default, if no defaultModFunct is passed to imdb.IMDb, the
  string is returned with the "special marking" removed.
- I really don't know what "(qv)" means: it's used in the plain text
  data files. :-)

Cool and over-complicated: that's the way I like it! ;-)

> That way, you can click on a spouse if he/she has an imdb entry
> of his/her own (God, I hate this gender issue in English and other
> languages,

I use "his" for everything - may not be politically correct,
but I don't really care (moreover, it's grammatically correct
in Italian - even if recently everyone follow the English style...)


Thanks!
-- 
Davide Alberani <davide.alber...@gmail.com> [PGP KeyID: 0x465BFD47]
http://erlug.linux.it/~da/

------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
Imdbpy-devel mailing list
Imdbpy-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/imdbpy-devel

Reply via email to