Skip to content

Commit

Permalink
refactoring (#50)
Browse files Browse the repository at this point in the history
* small refactoring
  • Loading branch information
mantonovic authored Jan 7, 2020
1 parent dc8b68c commit 0065e99
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion scripts/istsos2istsos.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def log(message):
ssrv,
procedure
), auth=(suser, spwd), verify=False)
print(res.text)

sdata = res.json()
if sdata['success'] is False:
raise Exception(
Expand Down
11 changes: 5 additions & 6 deletions scripts/istsosutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def getSOSProceduresList(self):
}

print("Requesting a getCapabilitie: %s/%s" % (self.host, self.service))
print(params)
# print(params)

res = req.get("%s/%s" % (
self.host, self.service), params=params, auth=self.auth)
Expand All @@ -118,8 +118,8 @@ def getSOSProceduresList(self):
procedures = {}

for offering in offerings:
offeringName = offering.find(
"{%s}name" % (gcNs['gml'])).text.split(":")[-1]
# offeringName = offering.find(
# "{%s}name" % (gcNs['gml'])).text.split(":")[-1]

# For each offering get the procedures
elProcs = offering.findall("{%s}procedure" % (gcNs['sos']))
Expand All @@ -138,7 +138,6 @@ def getProcedures(self):
self.host, self.service
), auth=self.auth
)
print(res)
jsonRes = res.json()
if not jsonRes['success']:
raise Exception(
Expand All @@ -150,8 +149,8 @@ def getProcedures(self):
procedure.merge(data)
procedures.append(procedure)

print("Procedures list result:")
print(" - Found: %s procedures" % len(procedures))
# print("Procedures list result:")
# print(" - Found: %s procedures" % len(procedures))

return procedures

Expand Down

0 comments on commit 0065e99

Please sign in to comment.