Re: Refactor: Registry Classes - Mailing list pgadmin-hackers

From Akshay Joshi
Subject Re: Refactor: Registry Classes
Date
Msg-id CANxoLDcUuG1+yO0nGjXvZGwxnpofwyfsBNjOimSbvr40-6UPFw@mail.gmail.com
Whole thread Raw
In response to Re: Refactor: Registry Classes  (Ashesh Vashi <ashesh.vashi@enterprisedb.com>)
Responses Re: Refactor: Registry Classes  (Ashesh Vashi <ashesh.vashi@enterprisedb.com>)
List pgadmin-hackers
Hi Ashesh

Following are the review comments:
  • Fixed PEP8 issues.
  • In "dynamic_registry/__init__.py" decorator @classmethod used for "_get" and "_load_modules" methods which are actually outside of the class. Even constructor also outside of the class.
  • Remove unused imports from "driver/registry.py"
  • Fixed sonarqube issues in "dynamic_registry/tests/registry/__init__.py"

On Sat, Jun 19, 2021 at 11:27 AM Ashesh Vashi <ashesh.vashi@enterprisedb.com> wrote:
On Sat, Jun 19, 2021 at 1:39 AM Ashesh Vashi <ashesh.vashi@enterprisedb.com> wrote:
Hi Akshay,

We do have a couple of classes, which does automatic registration of the base classes,
and which creates single-ton objects for these base classes, when needed.

I would be working on a patch sooner, which will be using similar functionality for loading
the multi-factor authentication.

I realized - it will be a duplicate code at three places for the same functionalities.
Hence - I worked on refactoring this registry class.

Please find the patch for the same. 
Found issues - some test files were using the old function 'Driver.load_drivers(...)'.
They're fixed now.

-- Thanks, Ashesh

--

Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: Enterprise PostgreSQL Company


http://www.linkedin.com/in/asheshvashi



--
Thanks & Regards
Akshay Joshi
pgAdmin Hacker | Principal Software Architect
EDB Postgres
Mobile: +91 976-788-8246

pgadmin-hackers by date:

Previous
From: Akshay Joshi
Date:
Subject: Re: [pgAdmin][RM3920] Do not block the editor window when running a query
Next
From: Akshay Joshi
Date:
Subject: pgAdmin 4 commit: Ensure that Data Output panel can be snapped back aft