Re: [mirrorbrain] Two small patches

From: Peter Pöml <peter_at_poeml.de>
Date: Tue, 19 Jun 2012 00:13:16 +0200
Hi Gökdeniz,

Am 18.06.2012 um 22:31 schrieb Gökdeniz Karadağ:
> I have two patches for mirrorbrain
> They live in branches in this git repo:
> https://github.com/hayalci/mirrorbrain
> 
> Individual patches are:
> 
> https://github.com/hayalci/mirrorbrain/commit/b4618c7838.patch
> pach that adds a command line option for configuration file path

Thanks, applied!

> https://github.com/hayalci/mirrorbrain/commit/d1cad17.patch
> patch catches an additional ProgrammingError exception that gets thrown from sqlobject.dberrors namespace, if mod_asn is not installed.

Here I have a suggestion for cosmetic improvement:

To avoid importing the sqlobject namespace both in its own namespace (which you added) as well as with * into the current namespace (as was already present), we could stick to the existing and write the addition as this:

--- mb/mb/conn.py	(revision 8294)
+++ mb/mb/conn.py	(working copy)
_at_@ -188,7 +188,7 @@
                     fromDatabase = True
                     defaultOrder = 'asn'
             self.Pfx2asn = Pfx2asn
-        except psycopg2.ProgrammingError:
+        except (dberrors.ProgrammingError, psycopg2.ProgrammingError):
             # this is the error which we get if mod_asn doesn't happen
             # to be installed as well
             pass


It should yield the same result. Alright?

Thank you very much for the patch. I believe that somebody ran into this bug recently. 

I hope that dberrors.ProgrammingError exists in older versions as well, but we'll see :-)

Peter


_______________________________________________
mirrorbrain mailing list
Archive: http://mirrorbrain.org/archive/mirrorbrain/

Note: To remove yourself from this mailing list, send a mail with the content
 	unsubscribe
to the address mirrorbrain-request_at_mirrorbrain.org
Received on Mon Jun 18 2012 - 22:13:17 GMT

This archive was generated by hypermail 2.3.0 : Mon Jun 18 2012 - 23:17:03 GMT