Skip to content

Commit

Permalink
moving build_postgis_dict() method to modules/results/display.py
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonSAMPERE committed Jul 30, 2019
1 parent f25e18c commit 2e77b1d
Showing 1 changed file with 0 additions and 56 deletions.
56 changes: 0 additions & 56 deletions modules/layer/add_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,62 +88,6 @@ def __init__(self):
self.tr = None
self.md_sync = MetadataSynchronizer()

def build_postgis_dict(self, input_dict):
"""Build the dict that stores informations about PostGIS connexions."""
# input_dict.beginGroup("PostgreSQL/connections")
final_dict = {}
for k in sorted(input_dict.allKeys()):
if k.startswith("PostgreSQL/connections/")\
and k.endswith("/database"):
if len(k.split("/")) == 4:
connection_name = k.split("/")[2]
password_saved = input_dict.value(
'PostgreSQL/connections/' +
connection_name +
'/savePassword')
user_saved = input_dict.value(
'PostgreSQL/connections/' +
connection_name +
'/saveUsername')
if password_saved == 'true' and user_saved == 'true':
dictionary = {'name':
input_dict.value(
'PostgreSQL/connections/' +
connection_name +
'/database'),
'host':
input_dict.value(
'PostgreSQL/connections/' +
connection_name +
'/host'),
'port':
input_dict.value(
'PostgreSQL/connections/' +
connection_name +
'/port'),
'username':
input_dict.value(
'PostgreSQL/connections/' +
connection_name +
'/username'),
'password':
input_dict.value(
'PostgreSQL/connections/' +
connection_name +
'/password')}
final_dict[
input_dict.value('PostgreSQL/connections/' +
connection_name +
'/database')
] = dictionary
else:
continue
else:
pass
else:
pass
return final_dict

def build_efs_url(self, api_layer, srv_details, rsc_type="ds_dyn_lyr_srv", mode="complete"):
"""Reformat the input Esri Feature Service url so it fits QGIS criterias.
Expand Down

0 comments on commit 2e77b1d

Please sign in to comment.