Python 2.6 support fixes.

This commit is contained in:
Harshal Dhumal 2016-01-27 15:59:54 +01:00 committed by Dave Page
parent d6d8a2348e
commit b77c5a6c54
5 changed files with 9 additions and 9 deletions

View File

@ -27,3 +27,4 @@ speaklater==1.3
pycrypto==2.6.1
wsgiref==0.1.2
simplejson==3.6.5
importlib==1.0.3

View File

@ -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

View File

@ -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."),

View File

@ -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

View File

@ -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 = []