Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 15, 2024
1 parent 0caa896 commit 6060e46
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
15 changes: 4 additions & 11 deletions osm_fieldwork/OdkCentral.py
Original file line number Diff line number Diff line change
Expand Up @@ -961,13 +961,8 @@ def publishForm(
log.info(f"Published {xform} on Central.")
return result.status_code


def form_fields(self,
projectId:int,
xform:str):

"""
Retrieves the form fields for a xform from odk central.
def form_fields(self, projectId: int, xform: str):
"""Retrieves the form fields for a xform from odk central.
Args:
projectId (int): The ID of the project on ODK Central
Expand All @@ -977,17 +972,15 @@ def form_fields(self,
dict: A json object containing the form fields.
"""

if xform.find("_") > 0:
xid = xform.split('_')[2]
xid = xform.split("_")[2]
else:
xid = xform

url = f"{self.base}projects/{projectId}/forms/{xid}/fields?odata=true"
result=self.session.get(url, auth=self.auth)
result = self.session.get(url, auth=self.auth)
return result.json()


def dump(self):
"""Dump internal data structures, for debugging purposes only."""
# super().dump()
Expand Down
2 changes: 1 addition & 1 deletion osm_fieldwork/filter_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def cleanData(
continue
log.warning(f"Tag {key} not in the data model!")
continue
if 'title' not in properties:
if "title" not in properties:
properties["label"] = properties["id"]
properties["title"] = properties["id"]
newfeature = Feature(geometry=feature["geometry"], properties=properties)
Expand Down

0 comments on commit 6060e46

Please sign in to comment.