[Imdbpy-devel] new small features

20 views
Skip to first unread message

Davide Alberani

unread,
Mar 24, 2012, 11:34:41 AM3/24/12
to IMDbPY development
Two new small features in the mercurial/git repository:
- "reraiseExceptions" option (can be used programmatically -
instancing IMDb - or
in the imdbpy.cfg configuration file) to re-raise any caught exceptions.
Default to False, could be useful in some circumstances.
- "timeout" option (can be used like "reraiseExceptions") to set a
timeout in seconds
for the http connections. By default I've set it at 30 seconds.
Can be disabled
entirely setting it to False or None.

And an improvement:
- better SQL statements for the creation of temporary tables (re)storing
imdbIDs... it should work gracefully with postgresql and possibly
other databases.

As usual, please report any problem and strange behavior: I'm not too sure
about the consequences of these changes. :-)


--
Davide Alberani <davide....@gmail.com>  [PGP KeyID: 0x465BFD47]
http://www.mimante.net/

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Imdbpy-devel mailing list
Imdbpy...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/imdbpy-devel

Davide Alberani

unread,
Apr 15, 2012, 4:52:08 AM4/15/12
to Albert Claret, imdbpy...@googlegroups.com, IMDbPY development
On Tue, Apr 10, 2012 at 15:59, Albert Claret <acl...@gmail.com> wrote:
>

Hi and pardo for the delay: very busy weeks.

> Both features seem very interesting, will reraiseExceptions allow us to
> catch Exceptions from our own programs?

Yes, that's the idea. Not much tested, as usual. :-P

> I haven't figured out a way to properly intercept an Exception (for example,
> a connection error) raised by the imdbpy module from my own code to, allow
> the operation to be retried, for example. I assume that setting
> reraiseExceptions and catching them from my own code should work, right?

The IMDbPY exceptions are organized in a small hierarchy:
- IMDbError : Base class for every exception raised by the imdb package.
|
+-> IMDbDataAccessError: unable to access some data
+-> IMDbParserError : unable to parse something

You can import them from the imdb._exceptions module.
If you want to catch them all, use IMDbError.

Reply all
Reply to author
Forward
0 new messages