Skip to content

Commit 94fb57c

Browse files
authored
Strip out redundant __new__ to enable object pickling (#548)
1 parent f3584aa commit 94fb57c

File tree

3 files changed

+0
-126
lines changed

3 files changed

+0
-126
lines changed

owslib/feature/wfs100.py

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -73,48 +73,6 @@ class WebFeatureService_1_0_0(object):
7373
7474
Implements IWebFeatureService.
7575
"""
76-
77-
def __new__(
78-
self,
79-
url,
80-
version,
81-
xml,
82-
parse_remote_metadata=False,
83-
timeout=30,
84-
headers=None,
85-
username=None,
86-
password=None,
87-
auth=None,
88-
):
89-
""" overridden __new__ method
90-
91-
@type url: string
92-
@param url: url of WFS capabilities document
93-
@type xml: string
94-
@param xml: elementtree object
95-
@type parse_remote_metadata: boolean
96-
@param parse_remote_metadata: whether to fully process MetadataURL elements
97-
@param headers: HTTP headers to send with requests
98-
@param timeout: time (in seconds) after which requests should timeout
99-
@param username: service authentication username
100-
@param password: service authentication password
101-
@param auth: instance of owslib.util.Authentication
102-
@return: initialized WebFeatureService_1_0_0 object
103-
"""
104-
obj = object.__new__(self)
105-
obj.__init__(
106-
url,
107-
version,
108-
xml,
109-
parse_remote_metadata,
110-
timeout,
111-
headers=headers,
112-
username=username,
113-
password=password,
114-
auth=auth,
115-
)
116-
return obj
117-
11876
def __getitem__(self, name):
11977
""" check contents dictionary to allow dict like access to service layers"""
12078
if name in list(self.__getattribute__("contents").keys()):

owslib/feature/wfs110.py

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -56,48 +56,6 @@ class WebFeatureService_1_1_0(WebFeatureService_):
5656
5757
Implements IWebFeatureService.
5858
"""
59-
60-
def __new__(
61-
self,
62-
url,
63-
version,
64-
xml,
65-
parse_remote_metadata=False,
66-
timeout=30,
67-
headers=None,
68-
username=None,
69-
password=None,
70-
auth=None,
71-
):
72-
""" overridden __new__ method
73-
74-
@type url: string
75-
@param url: url of WFS capabilities document
76-
@type xml: string
77-
@param xml: elementtree object
78-
@type parse_remote_metadata: boolean
79-
@param parse_remote_metadata: whether to fully process MetadataURL elements
80-
@param headers: HTTP headers to send with requests
81-
@param timeout: time (in seconds) after which requests should timeout
82-
@param username: service authentication username
83-
@param password: service authentication password
84-
@param auth: instance of owslib.util.Authentication
85-
@return: initialized WebFeatureService_1_1_0 object
86-
"""
87-
obj = object.__new__(self)
88-
obj.__init__(
89-
url,
90-
version,
91-
xml,
92-
parse_remote_metadata,
93-
timeout,
94-
headers=headers,
95-
username=username,
96-
password=password,
97-
auth=auth,
98-
)
99-
return obj
100-
10159
def __getitem__(self, name):
10260
""" check contents dictionary to allow dict like access to service layers"""
10361
if name in list(self.__getattribute__("contents").keys()):

owslib/feature/wfs200.py

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -45,48 +45,6 @@ class WebFeatureService_2_0_0(WebFeatureService_):
4545
4646
Implements IWebFeatureService.
4747
"""
48-
49-
def __new__(
50-
self,
51-
url,
52-
version,
53-
xml,
54-
parse_remote_metadata=False,
55-
timeout=30,
56-
headers=None,
57-
username=None,
58-
password=None,
59-
auth=None,
60-
):
61-
""" overridden __new__ method
62-
63-
@type url: string
64-
@param url: url of WFS capabilities document
65-
@type xml: string
66-
@param xml: elementtree object
67-
@type parse_remote_metadata: boolean
68-
@param parse_remote_metadata: whether to fully process MetadataURL elements
69-
@param headers: HTTP headers to send with requests
70-
@param timeout: time (in seconds) after which requests should timeout
71-
@param username: service authentication username
72-
@param password: service authentication password
73-
@param auth: instance of owslib.util.Authentication
74-
@return: initialized WebFeatureService_2_0_0 object
75-
"""
76-
obj = object.__new__(self)
77-
obj.__init__(
78-
url,
79-
version,
80-
xml,
81-
parse_remote_metadata,
82-
timeout,
83-
headers=headers,
84-
username=username,
85-
password=password,
86-
auth=auth,
87-
)
88-
return obj
89-
9048
def __getitem__(self, name):
9149
""" check contents dictionary to allow dict like access to service layers"""
9250
if name in list(self.__getattribute__("contents").keys()):

0 commit comments

Comments
 (0)