Re: Can someone tell me what this code does ?

From: Dave Cramer <davecramer(at)gmail(dot)com>
To: Murtuza Zabuawala <murtuza(dot)zabuawala(at)enterprisedb(dot)com>
Cc: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: Can someone tell me what this code does ?
Date: 2017-08-08 13:07:00
Message-ID: CADK3HH+qhZnkAV58Re45_Vk-xd+FgeWar_8zCMVcyY=4RDDDrA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Hi,

I guess my question was a bit vague. I get that it loads drivers. But note
it does not actually put them anywhere.

First it creates a dict
sets the attribute in the app
loads the drivers dynamically
and returns an empty dict.

From what I can tell this:

DriverRegistry.load_drivers()

is all it does?

Dave Cramer

On 7 August 2017 at 23:35, Murtuza Zabuawala <
murtuza(dot)zabuawala(at)enterprisedb(dot)com> wrote:

> Hi,
>
> This piece of code allow us to dynamically import all the available driver
> modules from '../utils/driver/' directory into our application.
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
> [image: https://community.postgresrocks.net/]
> <https://community.postgresrocks.net/>
>
> On Tue, Aug 8, 2017 at 4:20 AM, Dave Cramer <davecramer(at)gmail(dot)com> wrote:
>
>> I'm fairly new to Python so excuse my naiveté.
>>
>> This code: in web/pgadmin/utils/driver/__init__.py does not appear to
>> load the drivers into the drivers dictionary ? Or am I missing something
>>
>> def init_app(app):
>> drivers = dict()
>>
>> setattr(app, '_pgadmin_server_drivers', drivers)
>> DriverRegistry.load_drivers()
>>
>> return drivers
>>
>>
>>
>> Dave Cramer
>>
>
>

In response to

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Shirley Wang 2017-08-08 14:17:40 Re: [pgAdmin4][Patch]: Allow user to cancel long running queries from dashboard
Previous Message Dave Page 2017-08-08 10:33:12 Re: Unified server/desktop config