mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-09 23:15:58 -06:00
Python 2.6 support fixes.
This commit is contained in:
parent
d6d8a2348e
commit
b77c5a6c54
@ -27,3 +27,4 @@ speaklater==1.3
|
||||
pycrypto==2.6.1
|
||||
wsgiref==0.1.2
|
||||
simplejson==3.6.5
|
||||
importlib==1.0.3
|
||||
|
@ -79,8 +79,8 @@ class PgAdmin(Flask):
|
||||
for module in self.submodules:
|
||||
for key, value in module.menu_items.items():
|
||||
menu_items[key].extend(value)
|
||||
menu_items = {key: sorted(values, key=attrgetter('priority'))
|
||||
for key, values in menu_items.items()}
|
||||
menu_items = dict((key, sorted(value, key=attrgetter('priority')))
|
||||
for key, value in menu_items.items())
|
||||
return menu_items
|
||||
|
||||
|
||||
|
@ -325,9 +325,9 @@ class ServerNode(PGChildNodeView):
|
||||
not_allowed = {}
|
||||
|
||||
if conn.connected():
|
||||
for arg in {
|
||||
for arg in (
|
||||
'host', 'port', 'db', 'username', 'sslmode', 'role'
|
||||
}:
|
||||
):
|
||||
if arg in data:
|
||||
return forbidden(
|
||||
errormsg=gettext(
|
||||
@ -660,7 +660,6 @@ class ServerNode(PGChildNodeView):
|
||||
|
||||
current_app.logger.info('Connection Established for server: \
|
||||
%s - %s' % (server.id, server.name))
|
||||
|
||||
return make_json_response(
|
||||
success=1,
|
||||
info=gettext("Server Connected."),
|
||||
|
@ -90,6 +90,6 @@ class PgAdminModule(Blueprint):
|
||||
for module in self.submodules:
|
||||
for key, value in module.menu_items.items():
|
||||
menu_items[key].extend(value)
|
||||
menu_items = {key: sorted(values, key=attrgetter('priority'))
|
||||
for key, values in menu_items.items()}
|
||||
menu_items = dict((key, sorted(value, key=attrgetter('priority')))
|
||||
for key, value in menu_items.items())
|
||||
return menu_items
|
||||
|
@ -372,7 +372,7 @@ Attempt to reconnect it failed with the below error:
|
||||
import copy
|
||||
# Get Resultset Column Name, Type and size
|
||||
columns = cur.description and [
|
||||
copy.deepcopy(desc.__dict__) for desc in cur.description
|
||||
copy.deepcopy(desc._asdict()) for desc in cur.description
|
||||
] or []
|
||||
|
||||
rows = []
|
||||
@ -414,7 +414,7 @@ Attempt to reconnect it failed with the below error:
|
||||
import copy
|
||||
# Get Resultset Column Name, Type and size
|
||||
columns = cur.description and [
|
||||
copy.deepcopy(desc.__dict__) for desc in cur.description
|
||||
copy.deepcopy(desc._asdict()) for desc in cur.description
|
||||
] or []
|
||||
|
||||
rows = []
|
||||
|
Loading…
Reference in New Issue
Block a user