Skip to content

Commit

Permalink
Merge pull request #2 from otovo/andrewdi/modify
Browse files Browse the repository at this point in the history
  • Loading branch information
Alaricniall authored Mar 10, 2023
2 parents 9d7bdb3 + 517573f commit 3555959
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
.cache
.coverage
.tox
.idea
/build/
/dist/
/venv/
Expand Down
36 changes: 34 additions & 2 deletions netsuite/soap_api/transports.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,39 @@
__all__ = ("AsyncNetSuiteTransport",)


# TODO: ASYNC! Maybe remove this custom transport?!?!

# def SuperInit(
# self,
# client=None,
# wsdl_client=None,
# cache=None,
# timeout=300,
# operation_timeout=None,
# verify_ssl=True,
# proxy=None,
# ):
# if httpx is None:
# raise RuntimeError("The AsyncTransport is based on the httpx module")
#
# self._close_session = False
# self.cache = cache
# self.wsdl_client = wsdl_client or httpx.Client(
# verify=verify_ssl,
# proxies=proxy,
# timeout=timeout,
# )
# self.client = client or httpx.AsyncClient(
# verify=verify_ssl,
# proxies=proxy,
# timeout=operation_timeout,
# )
# self.logger = logging.getLogger(__name__)
#
# self.wsdl_client.headers = {
# "User-Agent": "Zeep/%s (www.python-zeep.org)" % (get_version())
# }
# self.client.headers = {
# "User-Agent": "Zeep/%s (www.python-zeep.org)" % (get_version())
# }

class AsyncNetSuiteTransport(zeep.transports.AsyncTransport):
"""
Expand All @@ -23,6 +54,7 @@ class AsyncNetSuiteTransport(zeep.transports.AsyncTransport):
def __init__(self, wsdl_url, *args, **kwargs):
parsed = urllib.parse.urlparse(wsdl_url)
self._netsuite_base_url = f"{parsed.scheme}://{parsed.netloc}"
self.session = kwargs.pop('session')
super().__init__(*args, **kwargs)

def _fix_address(self, address):
Expand Down

0 comments on commit 3555959

Please sign in to comment.