Skip to content

Commit

Permalink
[IMP][T7009]bad_connector_woocommerce:black,isort,prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
PAA authored and PAA committed Dec 18, 2023
1 parent e062b4e commit b165cda
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
10 changes: 5 additions & 5 deletions bad_connector_woocommerce/components/backend_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
_logger = logging.getLogger(__name__)


class WooLocation(object):
class WooLocation:
"""The Class is used to set Location"""

def __init__(self, location, client_id, client_secret, version, test_mode):
Expand All @@ -28,7 +28,7 @@ def location(self):
return self._location


class WooAPI(object):
class WooAPI:
def __init__(self, location):
"""
:param location: Remote location
Expand Down Expand Up @@ -117,7 +117,7 @@ def call(self, resource_path, arguments, http_method=None):
)
result.raise_for_status()
return result
except (socket.gaierror, socket.error, socket.timeout) as err:
except (OSError, socket.gaierror, socket.timeout) as err:
raise NetworkRetryableError(
"A network error caused the failure of the job: " "%s" % err
) from err
Expand Down Expand Up @@ -230,7 +230,7 @@ def search(self, filters=None, **kwargs):

def read(self, external_id=None, attributes=None):
"""Method to get a data for specified record"""
resource_path = "{}/{}".format(self._woo_model, external_id)
resource_path = f"{self._woo_model}/{external_id}"
result = self._call(resource_path, http_method="get")
result = result.get("data", [])
return result
Expand All @@ -242,7 +242,7 @@ def create(self, data):

def write(self, external_id, data):
"""Update records on the external system"""
resource_path = "{}/{}".format(self._woo_model, external_id)
resource_path = f"{self._woo_model}/{external_id}"
if data.get("template_external_id", False):
resource_path = "{}/{}/variations/{}".format(
self._woo_model, data.get("template_external_id"), external_id
Expand Down
4 changes: 2 additions & 2 deletions bad_connector_woocommerce/models/woo_backend/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def _sync_from_date(
force=False,
force_update_field=None,
job_options=None,
**kwargs
**kwargs,
):
"""New Method: Generic Method to import/export records based on the params"""
self.ensure_one()
Expand Down Expand Up @@ -300,7 +300,7 @@ def _sync_from_date(
filters=filters,
date_field=date_field,
job_options=job_options,
**kwargs
**kwargs,
)
else:
force = self[force_update_field] if force_update_field else False
Expand Down
3 changes: 3 additions & 0 deletions bad_connector_woocommerce/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
3 changes: 3 additions & 0 deletions grouped_product_bad_connector_woocommerce/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"

0 comments on commit b165cda

Please sign in to comment.