From 6060e4626e53ddf28f9a018adab5b43a9940946f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 15 Jan 2024 16:39:53 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- osm_fieldwork/OdkCentral.py | 15 ++++----------- osm_fieldwork/filter_data.py | 2 +- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/osm_fieldwork/OdkCentral.py b/osm_fieldwork/OdkCentral.py index 8ca3881e..7c871a43 100755 --- a/osm_fieldwork/OdkCentral.py +++ b/osm_fieldwork/OdkCentral.py @@ -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 @@ -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() diff --git a/osm_fieldwork/filter_data.py b/osm_fieldwork/filter_data.py index ae1d939d..e3be0fea 100755 --- a/osm_fieldwork/filter_data.py +++ b/osm_fieldwork/filter_data.py @@ -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)