Skip to content

Commit 9a9d72f

Browse files
Merge branch 'master' into max_occurs-logging
2 parents 11a7a2a + 6bd479e commit 9a9d72f

37 files changed

+290
-226
lines changed

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ install:
55
pip install bumpversion twine wheel
66

77
lint:
8-
flake8 src/ tests/
8+
flake8 src/
9+
flake8 --ignore=E501 tests/
910
isort --recursive --check-only --diff src tests
1011

1112
clean:
@@ -26,6 +27,6 @@ docs:
2627

2728
release:
2829
pip install twine wheel
29-
rm -rf dist/*
30+
rm -rf build/* dist/*
3031
python setup.py sdist bdist_wheel
3132
twine upload -s dist/*

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
'pytest-tornado==0.4.5',
4040

4141
# Linting
42-
'isort==4.2.5',
42+
'isort==4.2.15',
4343
'flake8==3.3.0',
4444
'flake8-blind-except==0.1.1',
4545
'flake8-debugger==1.4.0',

src/zeep/asyncio/transport.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
"""
55
import asyncio
66
import logging
7-
from . import bindings
87

98
import aiohttp
109
from requests import Response
1110

11+
from zeep.asyncio import bindings
1212
from zeep.exceptions import TransportError
1313
from zeep.transports import Transport
1414
from zeep.utils import get_version

src/zeep/client.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ class OperationProxy(object):
1313
def __init__(self, service_proxy, operation_name):
1414
self._proxy = service_proxy
1515
self._op_name = operation_name
16+
try:
17+
signature = str(self._proxy._binding._operations[operation_name])
18+
self.__doc__ = signature
19+
except:
20+
self.__doc__ = 'OperationProxy for %s' % operation_name
1621

1722
def __call__(self, *args, **kwargs):
1823
"""Call the operation with the given args and kwargs.
@@ -67,6 +72,13 @@ def __getitem__(self, key):
6772
raise AttributeError('Service has no operation %r' % key)
6873
return OperationProxy(self, key)
6974

75+
def __dir__(self):
76+
""" Return the names of the operations. """
77+
return list(dir(super(ServiceProxy, self))
78+
+ list(self.__dict__)
79+
+ list(self._binding.port_type.operations))
80+
# using list() on the dicts for Python 3 compatibility
81+
7082

7183
class Factory(object):
7284
def __init__(self, types, kind, namespace):
@@ -133,6 +145,10 @@ def __init__(self, wsdl, wsse=None, transport=None,
133145
self._default_port_name = port_name
134146
self._default_soapheaders = None
135147

148+
@property
149+
def namespaces(self):
150+
return self.wsdl.types.prefix_map
151+
136152
@property
137153
def service(self):
138154
"""The default ServiceProxy instance

src/zeep/tornado/bindings.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
from zeep.wsdl import bindings
21
from tornado import gen
32

3+
from zeep.wsdl import bindings
4+
45
__all__ = ['AsyncSoap11Binding', 'AsyncSoap12Binding']
56

67

src/zeep/tornado/transport.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
"""
55
import logging
66
import urllib
7-
from . import bindings
87

9-
from tornado import gen, httpclient
108
from requests import Response, Session
119
from requests.auth import HTTPBasicAuth, HTTPDigestAuth
10+
from tornado import gen, httpclient
1211

12+
from zeep.tornado import bindings
1313
from zeep.transports import Transport
1414
from zeep.utils import get_version
1515
from zeep.wsdl.utils import etree_to_string
@@ -89,7 +89,7 @@ def fetch(self, address, method, headers, message=None):
8989
auth_password = self.session.password
9090
auth_mode = 'digest'
9191
else:
92-
raise StandardError('Not supported authentication.')
92+
raise Exception('Not supported authentication.')
9393

9494
# extracting client cert
9595
client_cert = None
@@ -111,7 +111,8 @@ def fetch(self, address, method, headers, message=None):
111111
'auth_username': auth_username,
112112
'auth_password': auth_password,
113113
'auth_mode': auth_mode,
114-
'validate_cert': self.session.verify,
114+
'validate_cert': self.session.verify is not None,
115+
'ca_certs': self.session.verify,
115116
'client_key': client_key,
116117
'client_cert': client_cert
117118
}
@@ -130,4 +131,4 @@ def new_response(self, response):
130131
new._content = response.body
131132
new.status_code = response.code
132133
new.headers = dict(response.headers.get_all())
133-
return new
134+
return new

src/zeep/xsd/elements/any.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def parse(self, xmlelement, schema, context=None):
5555
qname = etree.QName(xmlelement.tag)
5656
if context and context.schemas:
5757
for context_schema in context.schemas:
58-
if context_schema._has_schema_document(qname.namespace):
58+
if context_schema.documents.has_schema_document_for_ns(qname.namespace):
5959
schema = context_schema
6060
break
6161

0 commit comments

Comments
 (0)