Re: [pgadmin-hackers] [pgAdmin4][Patch]: RM1171 - Fix IE caching issue

2016-09-21 Thread Dave Page
Thanks, applied.

On Wed, Sep 21, 2016 at 2:40 PM, Surinder Kumar
 wrote:
> Hi
>
> I did git pull and applied the patch without any error. I have attached
> updated patch.
> Please apply this patch and let me know if any issue.
>
> On Wed, Sep 21, 2016 at 5:59 PM, Dave Page  wrote:
>>
>> Can you rebase please?
>>
>> piranha:web dpage$ git apply ~/Downloads/RM1171_v1.patch
>> error: patch failed: web/pgadmin/utils/ajax.py:29
>> error: web/pgadmin/utils/ajax.py: patch does not apply
>>
>> On Tue, Sep 20, 2016 at 2:58 PM, Surinder Kumar
>>  wrote:
>> > Missed method closing parenthesis while calling
>> >
>> > Please find updated patch
>> >
>> > On Tue, Sep 20, 2016 at 7:25 PM, Surinder Kumar
>> >  wrote:
>> >>
>> >> This patch has some issue in chrome while loading nodes. I will send
>> >> updated patch.
>> >>
>> >> On Tue, Sep 20, 2016 at 7:16 PM, Surinder Kumar
>> >>  wrote:
>> >>>
>> >>> Hi
>> >>>
>> >>> Issue:
>> >>> IE always caching the response data returned from the server and when
>> >>> same request is made for next time, it doesn't bring new data, instead
>> >>> it
>> >>> use cached data.
>> >>>
>> >>> Solution:
>> >>> Set cache to 'no-cache' in response headers while sending from the
>> >>> server
>> >>> side. This prevents browser from caching data every time an http
>> >>> request is
>> >>> made.
>> >>>
>> >>> Thanks to Harshal & Murtaza for discussing issue and solution.
>> >>>
>> >>> Please find attached patch and review.
>> >>>
>> >>>
>> >>> Thanks,
>> >>> Surinder Kumar
>> >>
>> >>
>> >
>> >
>> >
>> > --
>> > Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
>> > To make changes to your subscription:
>> > http://www.postgresql.org/mailpref/pgadmin-hackers
>> >
>>
>>
>>
>> --
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>> EnterpriseDB UK: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>
>



-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] pgAdmin 4 commit: Prevent browsers caching responses. Fixes #1171

2016-09-21 Thread Dave Page
Prevent browsers caching responses. Fixes #1171

Branch
--
master

Details
---
http://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=2077bd5fdccaa56893b3abf0ee09dcf754e889fc

Modified Files
--
web/pgadmin/utils/ajax.py | 18 --
1 file changed, 16 insertions(+), 2 deletions(-)


-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] Lack of activity indicator over slow connections (pgadmin4)

2016-09-21 Thread Dave Page
Hi

On Wed, Sep 21, 2016 at 2:30 PM, Surinder Kumar
 wrote:
> Hi Dave/Ashesh
>
> The thing we can do is:
> 1) We can display loading message same as other panels if returned response
> is taking longer than 2 seconds, otherwise we won't display any message(to
> avoid fluctuations).
> Screenshot - demo_message.png

There's a typo there (laoded)..

> 2) Display a loading spinner along with panel title while data is being
> loaded.
> Screenshot - spinner.png

I don't see a spinner there at all.

What about the other places I mentioned?

> On Wed, Sep 21, 2016 at 5:53 PM, Dave Page  wrote:
>>
>> Ashesh, Murtuza, Surinder,
>>
>> Some feedback or preferably a patch please? Release is next week!
>>
>> On Fri, Sep 16, 2016 at 3:36 PM, Magnus Hagander 
>> wrote:
>> > On Fri, Sep 16, 2016 at 3:35 AM, Dave Page  wrote:
>> >>
>> >> Ashesh, Murtuza, Surinder,
>> >>
>> >> Any thoughts on how we can achieve this easily, and where we're
>> >> lacking notifications? We did have activity notification in the
>> >> treeview, but that never worked overly well and now I come to think of
>> >> it, I don't recall seeing it recently. I'm thinking we need something:
>> >>
>> >> - On treeview node click
>> >>
>> >> - On dialogue open and OK
>> >>
>> >> - On Wizard steps
>> >>
>> >> - Possibly in the debugger, when stepping?
>> >>
>> >> I would think all that we need is to set the mouse cursor to
>> >> 'progress'.
>> >>
>> >
>> > Actually, the treeview spinner worked most of them time.  I'm not sure
>> > if it
>> > worked all the time - I didn't check that carefully - but it did work
>> > most
>> > of the mtime.
>> >
>> > But basically whatever *else* I clicked was the problem. In particular
>> > clicking the tabs out right, with the "Properties" and "SQL" tabs being
>> > the
>> > ones I used and they were extremely slow over the high latency
>> > connection (I
>> > measured almost 4 minutes as the worst time to load a SQL pane for a
>> > table
>> > with 11 columns and a couple of indexes and triggers) with lack of
>> > feedback.
>> >
>> > --
>> >  Magnus Hagander
>> >  Me: http://www.hagander.net/
>> >  Work: http://www.redpill-linpro.com/
>>
>>
>>
>> --
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>> EnterpriseDB UK: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>
>



-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] Patch for RM1720 [pgadmin4]

2016-09-21 Thread Dave Page
On Wed, Sep 21, 2016 at 4:02 PM, Navnath Gadakh
 wrote:
> Hi Dave,
> Can you please run testsuite for server or database node only, as
> there are some code modifications are remaining on the rest of the nodes.
> Currently i don't have a machine to look into issue, will check it tomorrow.

OK, here's the result:

(pgadmin4)piranha:web dpage$ python regression/runtests.py --pkg
browser.server_groups.servers.databases
pgAdmin 4 - Application Initialisation
==


The configuration database - '/Users/dpage/.pgadmin/test_pgadmin4.db'
does not exist.
Entering initial setup mode...
NOTE: Configuring authentication for SERVER mode.


The configuration database has been created at
/Users/dpage/.pgadmin/test_pgadmin4.db

=Running the test cases for 'Regression - PG 9.4'=
runTest 
(pgadmin.browser.server_groups.servers.databases.tests.test_db_add.DatabaseAddTestCase)
This function will add database under 1st server of tree node. (Check
Databases Node URL) ... ok
runTest 
(pgadmin.browser.server_groups.servers.databases.tests.test_db_delete.DatabaseDeleteTestCase)
This function will delete the database. (Check Databases Node URL) ... ok
runTest 
(pgadmin.browser.server_groups.servers.databases.tests.test_db_get.DatabasesGetTestCase)
This function will fetch added database. (Check Databases Node URL) ... ok
runTest 
(pgadmin.browser.server_groups.servers.databases.tests.test_db_put.DatabasesUpdateTestCase)
This function will update the comments field of database. (Check
Databases Node) ... ok

--
Ran 4 tests in 1.310s

OK

=Running the test cases for 'Regression - PG 9.5'=
runTest 
(pgadmin.browser.server_groups.servers.databases.tests.test_db_add.DatabaseAddTestCase)
This function will add database under 1st server of tree node. (Check
Databases Node URL) ... ok
runTest 
(pgadmin.browser.server_groups.servers.databases.tests.test_db_delete.DatabaseDeleteTestCase)
This function will delete the database. (Check Databases Node URL) ... FAIL
runTest 
(pgadmin.browser.server_groups.servers.databases.tests.test_db_get.DatabasesGetTestCase)
This function will fetch added database. (Check Databases Node URL) ... ERROR
runTest 
(pgadmin.browser.server_groups.servers.databases.tests.test_db_put.DatabasesUpdateTestCase)
This function will update the comments field of database. (Check
Databases Node) ... ERROR

==
ERROR: runTest 
(pgadmin.browser.server_groups.servers.databases.tests.test_db_get.DatabasesGetTestCase)
This function will fetch added database. (Check Databases Node URL)
--
Traceback (most recent call last):
  File 
"/Users/dpage/git/pgadmin4/web/pgadmin/browser/server_groups/servers/databases/tests/test_db_get.py",
line 33, in runTest
self.db_id)
  File 
"/Users/dpage/git/pgadmin4/web/pgadmin/browser/server_groups/servers/databases/tests/utils.py",
line 142, in verify_database
follow_redirects=True)
  File 
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/werkzeug/test.py",
line 788, in post
return self.open(*args, **kw)
  File 
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/testing.py",
line 113, in open
follow_redirects=follow_redirects)
  File 
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/werkzeug/test.py",
line 751, in open
response = self.run_wsgi_app(environ, buffered=buffered)
  File 
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/werkzeug/test.py",
line 668, in run_wsgi_app
rv = run_wsgi_app(self.application, environ, buffered=buffered)
  File 
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/werkzeug/test.py",
line 871, in run_wsgi_app
app_rv = app(environ, start_response)
  File 
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 2000, in __call__
return self.wsgi_app(environ, start_response)
  File 
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 1991, in wsgi_app
response = self.make_response(self.handle_exception(e))
  File 
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 1567, in handle_exception
reraise(exc_type, exc_value, tb)
  File 
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 1988, in wsgi_app
response = self.full_dispatch_request()
  File 
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 1641, in full_dispatch_request
rv = self.handle_user_exception(e)
  File 
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 1544, in handle_user_exception
reraise(exc_type, exc_value, tb)
  File 

Re: [pgadmin-hackers] Patch for RM1720 [pgadmin4]

2016-09-21 Thread Navnath Gadakh
Hi Dave,
Can you please run testsuite for server or database node only, as
there are some code modifications are remaining on the rest of the nodes.
Currently i don't have a machine to look into issue, will check it tomorrow.

Thanks.

On 21-Sep-2016 6:50 PM, "Dave Page"  wrote:

> Hi
>
> On Wed, Sep 21, 2016 at 1:57 PM, Harshal Dhumal
>  wrote:
> > Hi,
> >
> > PFA patch for RM1720
> >
> >
> > Issue: In pgAdmin4 we use server id (sid, which is id of server table in
> > sqlite db) as key to keep track of server connection (server manger). But
> > sqlite reuses these ids and therefore pgadmin4 connection manager assigns
> > connection details of one database server to another in some cases.
> >
> > To avoid this issue we now deleting server connection details (server
> > manger) when user drops server.
>
> Looks like it still needs some work I'm afraid (though, I think the
> approach is correct). Here's what I get running the regression tests:
>
> Interestingly; the error seen when running the test against PG 9.4
> isn't detected as a failure. Can you look at that aspect please
> Navnath?
>
>
> (pgadmin4)piranha:web dpage$ python regression/runtests.py
> pgAdmin 4 - Application Initialisation
> ==
>
>
> The configuration database - '/Users/dpage/.pgadmin/test_pgadmin4.db'
> does not exist.
> Entering initial setup mode...
> NOTE: Configuring authentication for SERVER mode.
>
>
> The configuration database has been created at
> /Users/dpage/.pgadmin/test_pgadmin4.db
>
> =Running the test cases for 'Regression - PG 9.4'=
> runTest (pgadmin.browser.server_groups.servers.databases.
> tests.test_db_add.DatabaseAddTestCase)
> This function will add database under 1st server of tree node. (Check
> Databases Node URL) ... ok
> runTest (pgadmin.browser.server_groups.servers.databases.
> tests.test_db_delete.DatabaseDeleteTestCase)
> This function will delete the database. (Check Databases Node URL) ... ok
> runTest (pgadmin.browser.server_groups.servers.databases.
> tests.test_db_get.DatabasesGetTestCase)
> This function will fetch added database. (Check Databases Node URL) ... ok
> runTest (pgadmin.browser.server_groups.servers.databases.
> tests.test_db_put.DatabasesUpdateTestCase)
> This function will update the comments field of database. (Check
> Databases Node) ... ok
> runTest (pgadmin.browser.server_groups.servers.tests.test_
> server_add.ServersAddTestCase)
> This function will add the server under default server group. (Default
> Server Node url) ... ok
> runTest (pgadmin.browser.server_groups.servers.tests.test_server_delete.
> ServerDeleteTestCase)
> This function deletes the added server (Default Server Node url) ...
> 2016-09-21 14:15:58,737: ERROR pgadmin: 'NoneType' object has no
> attribute 'release'
> Traceback (most recent call last):
>   File "/Users/dpage/git/pgadmin4/web/pgadmin/browser/server_
> groups/servers/__init__.py",
> line 355, in delete
> get_driver(PG_DEFAULT_DRIVER).delete_manager(sid)
>   File "/Users/dpage/git/pgadmin4/web/pgadmin/utils/driver/
> psycopg2/__init__.py",
> line 1729, in delete_manager
> manager.release()
> AttributeError: 'NoneType' object has no attribute 'release'
> ok
> runTest (pgadmin.browser.server_groups.servers.tests.test_
> server_get.ServersGetTestCase)
> This function will fetch the added servers to object browser. (Default
> Server Node url) ... ok
> runTest (pgadmin.browser.server_groups.servers.tests.test_server_put.
> ServerUpdateTestCase)
> This function update the server details (Default Server Node url) ... ok
> runTest (pgadmin.browser.server_groups.tests.test_sg_get.SgNodeTestCase)
> This function will check available server groups. (Check Server Group
> Node) ... ok
> runTest (pgadmin.browser.tests.test_change_password.
> ChangePasswordTestCase)
> This function will check change password functionality. (TestCase for
> Validating Incorrect_New_Password) ... ok
> runTest (pgadmin.browser.tests.test_change_password.
> ChangePasswordTestCase)
> This function will check change password functionality. (TestCase for
> Validating New_Password_Less_Than_Min_Length) ... ok
> runTest (pgadmin.browser.tests.test_change_password.
> ChangePasswordTestCase)
> This function will check change password functionality. (TestCase for
> Validating Empty_New_Password) ... ok
> runTest (pgadmin.browser.tests.test_change_password.
> ChangePasswordTestCase)
> This function will check change password functionality. (TestCase for
> Validating Incorrect_Current_Password) ... ok
> runTest (pgadmin.browser.tests.test_change_password.
> ChangePasswordTestCase)
> This function will check change password functionality. (TestCase for
> Changing Valid_Password) ... ok
> runTest (pgadmin.browser.tests.test_login.LoginTestCase)
> This function checks login functionality. (TestCase for Checking
> Invalid_Password) ... ok
> runTest 

Re: [pgadmin-hackers] [pgAdmin4][Patch]: RM1171 - Fix IE caching issue

2016-09-21 Thread Surinder Kumar
​Hi

I did git pull and applied the patch without any error.​ I have attached
updated patch.
Please apply this patch and let me know if any issue.

On Wed, Sep 21, 2016 at 5:59 PM, Dave Page  wrote:

> Can you rebase please?
>
> piranha:web dpage$ git apply ~/Downloads/RM1171_v1.patch
> error: patch failed: web/pgadmin/utils/ajax.py:29
> error: web/pgadmin/utils/ajax.py: patch does not apply
>
> On Tue, Sep 20, 2016 at 2:58 PM, Surinder Kumar
>  wrote:
> > Missed method closing parenthesis while calling
> >
> > Please find updated patch
> >
> > On Tue, Sep 20, 2016 at 7:25 PM, Surinder Kumar
> >  wrote:
> >>
> >> This patch has some issue in chrome while loading nodes. I will send
> >> updated patch.
> >>
> >> On Tue, Sep 20, 2016 at 7:16 PM, Surinder Kumar
> >>  wrote:
> >>>
> >>> Hi
> >>>
> >>> Issue:
> >>> IE always caching the response data returned from the server and when
> >>> same request is made for next time, it doesn't bring new data, instead
> it
> >>> use cached data.
> >>>
> >>> Solution:
> >>> Set cache to 'no-cache' in response headers while sending from the
> server
> >>> side. This prevents browser from caching data every time an http
> request is
> >>> made.
> >>>
> >>> Thanks to Harshal & Murtaza for discussing issue and solution.
> >>>
> >>> Please find attached patch and review.
> >>>
> >>>
> >>> Thanks,
> >>> Surinder Kumar
> >>
> >>
> >
> >
> >
> > --
> > Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
> > To make changes to your subscription:
> > http://www.postgresql.org/mailpref/pgadmin-hackers
> >
>
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


RM1171_v2.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] Patch for RM1720 [pgadmin4]

2016-09-21 Thread Dave Page
Hi

On Wed, Sep 21, 2016 at 1:57 PM, Harshal Dhumal
 wrote:
> Hi,
>
> PFA patch for RM1720
>
>
> Issue: In pgAdmin4 we use server id (sid, which is id of server table in
> sqlite db) as key to keep track of server connection (server manger). But
> sqlite reuses these ids and therefore pgadmin4 connection manager assigns
> connection details of one database server to another in some cases.
>
> To avoid this issue we now deleting server connection details (server
> manger) when user drops server.

Looks like it still needs some work I'm afraid (though, I think the
approach is correct). Here's what I get running the regression tests:

Interestingly; the error seen when running the test against PG 9.4
isn't detected as a failure. Can you look at that aspect please
Navnath?


(pgadmin4)piranha:web dpage$ python regression/runtests.py
pgAdmin 4 - Application Initialisation
==


The configuration database - '/Users/dpage/.pgadmin/test_pgadmin4.db'
does not exist.
Entering initial setup mode...
NOTE: Configuring authentication for SERVER mode.


The configuration database has been created at
/Users/dpage/.pgadmin/test_pgadmin4.db

=Running the test cases for 'Regression - PG 9.4'=
runTest 
(pgadmin.browser.server_groups.servers.databases.tests.test_db_add.DatabaseAddTestCase)
This function will add database under 1st server of tree node. (Check
Databases Node URL) ... ok
runTest 
(pgadmin.browser.server_groups.servers.databases.tests.test_db_delete.DatabaseDeleteTestCase)
This function will delete the database. (Check Databases Node URL) ... ok
runTest 
(pgadmin.browser.server_groups.servers.databases.tests.test_db_get.DatabasesGetTestCase)
This function will fetch added database. (Check Databases Node URL) ... ok
runTest 
(pgadmin.browser.server_groups.servers.databases.tests.test_db_put.DatabasesUpdateTestCase)
This function will update the comments field of database. (Check
Databases Node) ... ok
runTest 
(pgadmin.browser.server_groups.servers.tests.test_server_add.ServersAddTestCase)
This function will add the server under default server group. (Default
Server Node url) ... ok
runTest 
(pgadmin.browser.server_groups.servers.tests.test_server_delete.ServerDeleteTestCase)
This function deletes the added server (Default Server Node url) ...
2016-09-21 14:15:58,737: ERROR pgadmin: 'NoneType' object has no
attribute 'release'
Traceback (most recent call last):
  File 
"/Users/dpage/git/pgadmin4/web/pgadmin/browser/server_groups/servers/__init__.py",
line 355, in delete
get_driver(PG_DEFAULT_DRIVER).delete_manager(sid)
  File 
"/Users/dpage/git/pgadmin4/web/pgadmin/utils/driver/psycopg2/__init__.py",
line 1729, in delete_manager
manager.release()
AttributeError: 'NoneType' object has no attribute 'release'
ok
runTest 
(pgadmin.browser.server_groups.servers.tests.test_server_get.ServersGetTestCase)
This function will fetch the added servers to object browser. (Default
Server Node url) ... ok
runTest 
(pgadmin.browser.server_groups.servers.tests.test_server_put.ServerUpdateTestCase)
This function update the server details (Default Server Node url) ... ok
runTest (pgadmin.browser.server_groups.tests.test_sg_get.SgNodeTestCase)
This function will check available server groups. (Check Server Group
Node) ... ok
runTest (pgadmin.browser.tests.test_change_password.ChangePasswordTestCase)
This function will check change password functionality. (TestCase for
Validating Incorrect_New_Password) ... ok
runTest (pgadmin.browser.tests.test_change_password.ChangePasswordTestCase)
This function will check change password functionality. (TestCase for
Validating New_Password_Less_Than_Min_Length) ... ok
runTest (pgadmin.browser.tests.test_change_password.ChangePasswordTestCase)
This function will check change password functionality. (TestCase for
Validating Empty_New_Password) ... ok
runTest (pgadmin.browser.tests.test_change_password.ChangePasswordTestCase)
This function will check change password functionality. (TestCase for
Validating Incorrect_Current_Password) ... ok
runTest (pgadmin.browser.tests.test_change_password.ChangePasswordTestCase)
This function will check change password functionality. (TestCase for
Changing Valid_Password) ... ok
runTest (pgadmin.browser.tests.test_login.LoginTestCase)
This function checks login functionality. (TestCase for Checking
Invalid_Password) ... ok
runTest (pgadmin.browser.tests.test_login.LoginTestCase)
This function checks login functionality. (Empty_Password) ... ok
runTest (pgadmin.browser.tests.test_login.LoginTestCase)
This function checks login functionality. (Empty_Email) ... ok
runTest (pgadmin.browser.tests.test_login.LoginTestCase)
This function checks login functionality. (Empty_Credentials) ... ok
runTest (pgadmin.browser.tests.test_login.LoginTestCase)
This function checks login functionality. (Invalid_Email) ... ok
runTest (pgadmin.browser.tests.test_login.LoginTestCase)
This 

[pgadmin-hackers] Patch for RM1720 [pgadmin4]

2016-09-21 Thread Harshal Dhumal
Hi,

PFA patch for RM1720


Issue: In pgAdmin4 we use server id (sid, which is id of server table in
sqlite db) as key to keep track of server connection (server manger). But
sqlite reuses these ids and therefore pgadmin4 connection manager assigns
connection details of one database server to another in some cases.

To avoid this issue we now deleting server connection details (server
manger) when user drops server.

-- 
*Harshal Dhumal*
*Software Engineer*

EnterpriseDB India: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
diff --git a/web/pgadmin/browser/server_groups/servers/__init__.py b/web/pgadmin/browser/server_groups/servers/__init__.py
index 0b6c6ca..627cc5f 100644
--- a/web/pgadmin/browser/server_groups/servers/__init__.py
+++ b/web/pgadmin/browser/server_groups/servers/__init__.py
@@ -24,6 +24,7 @@ from pgadmin.utils.menu import MenuItem
 import config
 from config import PG_DEFAULT_DRIVER
 from pgadmin.model import db, Server, ServerGroup, User
+from pgadmin.utils.driver import get_driver
 
 
 def has_any(data, keys):
@@ -64,7 +65,6 @@ class ServerModule(sg.ServerGroupPluginModule):
 servers = Server.query.filter_by(user_id=current_user.id,
  servergroup_id=gid)
 
-from pgadmin.utils.driver import get_driver
 driver = get_driver(PG_DEFAULT_DRIVER)
 
 for server in servers:
@@ -156,7 +156,6 @@ class ServerModule(sg.ServerGroupPluginModule):
 sub-modules at once.
 """
 if first_registration:
-from pgadmin.utils.driver import get_driver
 driver = get_driver(PG_DEFAULT_DRIVER, app)
 app.jinja_env.filters['qtLiteral'] = driver.qtLiteral
 app.jinja_env.filters['qtIdent'] = driver.qtIdent
@@ -224,7 +223,6 @@ class ServerNode(PGChildNodeView):
 servers = Server.query.filter_by(user_id=current_user.id,
  servergroup_id=gid)
 
-from pgadmin.utils.driver import get_driver
 driver = get_driver(PG_DEFAULT_DRIVER)
 
 for server in servers:
@@ -293,7 +291,6 @@ class ServerNode(PGChildNodeView):
 )
 )
 
-from pgadmin.utils.driver import get_driver
 manager = get_driver(PG_DEFAULT_DRIVER).connection_manager(server.id)
 conn = manager.connection()
 connected = conn.connected()
@@ -355,6 +352,8 @@ class ServerNode(PGChildNodeView):
 for s in servers:
 db.session.delete(s)
 db.session.commit()
+get_driver(PG_DEFAULT_DRIVER).delete_manager(sid)
+
 except Exception as e:
 current_app.logger.exception(e)
 return make_json_response(
@@ -405,7 +404,6 @@ class ServerNode(PGChildNodeView):
 request.data, encoding='utf-8'
 )
 
-from pgadmin.utils.driver import get_driver
 manager = get_driver(PG_DEFAULT_DRIVER).connection_manager(sid)
 conn = manager.connection()
 connected = conn.connected()
@@ -473,7 +471,6 @@ class ServerNode(PGChildNodeView):
 ).first()
 res = []
 
-from pgadmin.utils.driver import get_driver
 driver = get_driver(PG_DEFAULT_DRIVER)
 
 for server in servers:
@@ -519,7 +516,6 @@ class ServerNode(PGChildNodeView):
 id=server.servergroup_id
 ).first()
 
-from pgadmin.utils.driver import get_driver
 driver = get_driver(PG_DEFAULT_DRIVER)
 
 manager = driver.connection_manager(sid)
@@ -594,7 +590,6 @@ class ServerNode(PGChildNodeView):
 user = None
 
 if 'connect_now' in data and data['connect_now']:
-from pgadmin.utils.driver import get_driver
 manager = get_driver(PG_DEFAULT_DRIVER).connection_manager(server.id)
 manager.update(server)
 conn = manager.connection()
@@ -663,7 +658,6 @@ class ServerNode(PGChildNodeView):
 return make_json_response(data='')
 
 def statistics(self, gid, sid):
-from pgadmin.utils.driver import get_driver
 manager = get_driver(PG_DEFAULT_DRIVER).connection_manager(sid)
 conn = manager.connection()
 
@@ -717,7 +711,6 @@ class ServerNode(PGChildNodeView):
 
 def connect_status(self, gid, sid):
 """Check and return the connection status."""
-from pgadmin.utils.driver import get_driver
 manager = get_driver(PG_DEFAULT_DRIVER).connection_manager(sid)
 conn = manager.connection()
 res = conn.connected()
@@ -769,7 +762,6 @@ class ServerNode(PGChildNodeView):
 save_password = False
 
 # Connect the Server
-from pgadmin.utils.driver import get_driver
 manager = get_driver(PG_DEFAULT_DRIVER).connection_manager(sid)
 conn = manager.connection()
 
@@ -902,7 +894,6 @@ class ServerNode(PGChildNodeView):
 return bad_request(gettext("Server not 

Re: [pgadmin-hackers] PATCH: To fix JSON array handling (pgAdmin4)

2016-09-21 Thread Dave Page
Thanks, applied.

On Wed, Sep 21, 2016 at 11:43 AM, Murtuza Zabuawala
 wrote:
> Hi,
>
> PFA patch to fix the issue where SlickGrid was not displaying nested JSON
> data properly.
> This patch fixes: RM#1713 & RM#1404
>
> Issue:
> Nested JSON data was not handled properly.
>
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
>
> --
> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgadmin-hackers
>



-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] pgAdmin 4 commit: Handle nested JSON correctly in SlickGrid. Fixes #171

2016-09-21 Thread Dave Page
Handle nested JSON correctly in SlickGrid. Fixes #1713. Fixes #1404

Branch
--
master

Details
---
http://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=7a401713008c516d45798ac258dc15fbd6977e29

Modified Files
--
.../static/js/slickgrid/slick.pgadmin.editors.js | 20 
.../static/js/slickgrid/slick.pgadmin.formatters.js  | 10 ++
.../sqleditor/templates/sqleditor/js/sqleditor.js|  2 +-
3 files changed, 31 insertions(+), 1 deletion(-)


-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] [pgAdmin4][Patch]: RM1171 - Fix IE caching issue

2016-09-21 Thread Dave Page
Can you rebase please?

piranha:web dpage$ git apply ~/Downloads/RM1171_v1.patch
error: patch failed: web/pgadmin/utils/ajax.py:29
error: web/pgadmin/utils/ajax.py: patch does not apply

On Tue, Sep 20, 2016 at 2:58 PM, Surinder Kumar
 wrote:
> Missed method closing parenthesis while calling
>
> Please find updated patch
>
> On Tue, Sep 20, 2016 at 7:25 PM, Surinder Kumar
>  wrote:
>>
>> This patch has some issue in chrome while loading nodes. I will send
>> updated patch.
>>
>> On Tue, Sep 20, 2016 at 7:16 PM, Surinder Kumar
>>  wrote:
>>>
>>> Hi
>>>
>>> Issue:
>>> IE always caching the response data returned from the server and when
>>> same request is made for next time, it doesn't bring new data, instead it
>>> use cached data.
>>>
>>> Solution:
>>> Set cache to 'no-cache' in response headers while sending from the server
>>> side. This prevents browser from caching data every time an http request is
>>> made.
>>>
>>> Thanks to Harshal & Murtaza for discussing issue and solution.
>>>
>>> Please find attached patch and review.
>>>
>>>
>>> Thanks,
>>> Surinder Kumar
>>
>>
>
>
>
> --
> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgadmin-hackers
>



-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] Lack of activity indicator over slow connections (pgadmin4)

2016-09-21 Thread Dave Page
Ashesh, Murtuza, Surinder,

Some feedback or preferably a patch please? Release is next week!

On Fri, Sep 16, 2016 at 3:36 PM, Magnus Hagander  wrote:
> On Fri, Sep 16, 2016 at 3:35 AM, Dave Page  wrote:
>>
>> Ashesh, Murtuza, Surinder,
>>
>> Any thoughts on how we can achieve this easily, and where we're
>> lacking notifications? We did have activity notification in the
>> treeview, but that never worked overly well and now I come to think of
>> it, I don't recall seeing it recently. I'm thinking we need something:
>>
>> - On treeview node click
>>
>> - On dialogue open and OK
>>
>> - On Wizard steps
>>
>> - Possibly in the debugger, when stepping?
>>
>> I would think all that we need is to set the mouse cursor to 'progress'.
>>
>
> Actually, the treeview spinner worked most of them time.  I'm not sure if it
> worked all the time - I didn't check that carefully - but it did work most
> of the mtime.
>
> But basically whatever *else* I clicked was the problem. In particular
> clicking the tabs out right, with the "Properties" and "SQL" tabs being the
> ones I used and they were extremely slow over the high latency connection (I
> measured almost 4 minutes as the worst time to load a SQL pane for a table
> with 11 columns and a couple of indexes and triggers) with lack of feedback.
>
> --
>  Magnus Hagander
>  Me: http://www.hagander.net/
>  Work: http://www.redpill-linpro.com/



-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] Regression errors - database node

2016-09-21 Thread Navnath Gadakh
Hi Dave,
 After a long debugging of these errors with Harshal, we found the
issue is in the handling pyscopg connection. Need to add some code in the
pyscopg connection manager as per Harshal.

For more details, Please refer RM #1720.


@Harshal, thanks for the time invested.

Thanks.



On Mon, Sep 19, 2016 at 9:22 PM, Dave Page  wrote:

> Hi Navnath
>
> I keep seeing the errors below when running tests. It seems to be
> consistent on EPAS, but intermittent on PG. Any ideas what the issue
> is? I'm fairly convinced it's a test issue not an actual problem.
>
> 2016-09-19 16:47:49,567:ERROR:STDERR:==
> 
> 2016-09-19 16:47:49,568:ERROR:STDERR:ERROR: runTest
> (pgadmin.browser.server_groups.servers.databases.tests.test_db_get.
> DatabasesGetTestCase)
> 2016-09-19 16:47:49,568:ERROR:STDERR:This function will fetch added
> database. (Check Databases Node URL)
> 2016-09-19 16:47:49,568:ERROR:STDERR:--
> 
> 2016-09-19 16:47:49,568:ERROR:STDERR:Traceback (most recent call last):
> 2016-09-19 16:47:49,568:ERROR:STDERR:  File
> "/Users/dpage/git/pgadmin4/web/pgadmin/browser/server_
> groups/servers/databases/tests/test_db_get.py",
> line 33, in runTest
> 2016-09-19 16:47:49,568:ERROR:STDERR:self.db_id)
> 2016-09-19 16:47:49,568:ERROR:STDERR:  File
> "/Users/dpage/git/pgadmin4/web/pgadmin/browser/server_
> groups/servers/databases/tests/utils.py",
> line 142, in verify_database
> 2016-09-19 16:47:49,568:ERROR:STDERR:follow_redirects=True)
> 2016-09-19 16:47:49,568:ERROR:STDERR:  File
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
> packages/werkzeug/test.py",
> line 788, in post
> 2016-09-19 16:47:49,568:ERROR:STDERR:return self.open(*args, **kw)
> 2016-09-19 16:47:49,568:ERROR:STDERR:  File
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
> packages/flask/testing.py",
> line 113, in open
> 2016-09-19 16:47:49,568:ERROR:STDERR:follow_redirects=follow_
> redirects)
> 2016-09-19 16:47:49,568:ERROR:STDERR:  File
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
> packages/werkzeug/test.py",
> line 751, in open
> 2016-09-19 16:47:49,568:ERROR:STDERR:response =
> self.run_wsgi_app(environ, buffered=buffered)
> 2016-09-19 16:47:49,568:ERROR:STDERR:  File
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
> packages/werkzeug/test.py",
> line 668, in run_wsgi_app
> 2016-09-19 16:47:49,568:ERROR:STDERR:rv =
> run_wsgi_app(self.application, environ, buffered=buffered)
> 2016-09-19 16:47:49,568:ERROR:STDERR:  File
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
> packages/werkzeug/test.py",
> line 871, in run_wsgi_app
> 2016-09-19 16:47:49,568:ERROR:STDERR:app_rv = app(environ,
> start_response)
> 2016-09-19 16:47:49,568:ERROR:STDERR:  File
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
> packages/flask/app.py",
> line 2000, in __call__
> 2016-09-19 16:47:49,568:ERROR:STDERR:return self.wsgi_app(environ,
> start_response)
> 2016-09-19 16:47:49,568:ERROR:STDERR:  File
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
> packages/flask/app.py",
> line 1991, in wsgi_app
> 2016-09-19 16:47:49,568:ERROR:STDERR:response =
> self.make_response(self.handle_exception(e))
> 2016-09-19 16:47:49,568:ERROR:STDERR:  File
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
> packages/flask/app.py",
> line 1567, in handle_exception
> 2016-09-19 16:47:49,568:ERROR:STDERR:reraise(exc_type, exc_value, tb)
> 2016-09-19 16:47:49,569:ERROR:STDERR:  File
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
> packages/flask/app.py",
> line 1988, in wsgi_app
> 2016-09-19 16:47:49,569:ERROR:STDERR:response =
> self.full_dispatch_request()
> 2016-09-19 16:47:49,569:ERROR:STDERR:  File
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
> packages/flask/app.py",
> line 1641, in full_dispatch_request
> 2016-09-19 16:47:49,569:ERROR:STDERR:rv = self.handle_user_exception(e)
> 2016-09-19 16:47:49,569:ERROR:STDERR:  File
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
> packages/flask/app.py",
> line 1544, in handle_user_exception
> 2016-09-19 16:47:49,569:ERROR:STDERR:reraise(exc_type, exc_value, tb)
> 2016-09-19 16:47:49,569:ERROR:STDERR:  File
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
> packages/flask/app.py",
> line 1639, in full_dispatch_request
> 2016-09-19 16:47:49,569:ERROR:STDERR:rv = self.dispatch_request()
> 2016-09-19 16:47:49,569:ERROR:STDERR:  File
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
> packages/flask/app.py",
> line 1625, in dispatch_request
> 2016-09-19 16:47:49,569:ERROR:STDERR:return
> self.view_functions[rule.endpoint](**req.view_args)
> 2016-09-19 16:47:49,569:ERROR:STDERR:  File
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
> 

[pgadmin-hackers] [pgAdmin4][Patch]: Background process executor won't run(in case of Backup, restore) in Windows only

2016-09-21 Thread Surinder Kumar
Hi

While working on RM*1391 *I found another issue* 'Backup is not working on
windows".*

The reason is that the process executor which uses subprocess Popen() to
execute job fails when we pass close_fds=True and shell=False in windows.

Now we are settings close_fds=False and shell=True to fix it. These
settings are specific to windows only.

Please review the attached patch.


Thanks,
Surinder Kumar


process_executor_not_running_in_win.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] PATCH: To fix JSON array handling (pgAdmin4)

2016-09-21 Thread Murtuza Zabuawala
Hi,

PFA patch to fix the issue where SlickGrid was not displaying nested JSON
data properly.
This patch fixes: RM#1713 & RM#1404

*Issue:*
Nested JSON data was not handled properly.


--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


RM_1713.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] Finalizing pgadmin4 RPM work

2016-09-21 Thread Devrim Gündüz

Hi Dave,

On Mon, 2016-09-19 at 12:03 +0100, Dave Page wrote:
> https://www.pgadmin.org/download/linux4.php
> 
> How's that? If you have instructions, please send me text (or better
> yet, a patch), and I'll add them.

I added packages for 9.4 and 9.5, too. Also wrote a basic blog post about this:

https://people.planetpostgresql.org/devrim/index.php?/archives/91-Installing-pgadmin4-to-Red-Hat,-CentOS,-and-Fedora.html

Cheers,
-- 
Devrim GÜNDÜZ
EnterpriseDB: http://www.enterprisedb.com
PostgreSQL Danışmanı/Consultant, Red Hat Certified Engineer
Twitter: @DevrimGunduz , @DevrimGunduzTR


signature.asc
Description: This is a digitally signed message part