Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strip out redundant __new__ to enable object pickling #548

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 0 additions & 42 deletions owslib/feature/wfs100.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,48 +73,6 @@ class WebFeatureService_1_0_0(object):

Implements IWebFeatureService.
"""

def __new__(
self,
url,
version,
xml,
parse_remote_metadata=False,
timeout=30,
headers=None,
username=None,
password=None,
auth=None,
):
""" overridden __new__ method

@type url: string
@param url: url of WFS capabilities document
@type xml: string
@param xml: elementtree object
@type parse_remote_metadata: boolean
@param parse_remote_metadata: whether to fully process MetadataURL elements
@param headers: HTTP headers to send with requests
@param timeout: time (in seconds) after which requests should timeout
@param username: service authentication username
@param password: service authentication password
@param auth: instance of owslib.util.Authentication
@return: initialized WebFeatureService_1_0_0 object
"""
obj = object.__new__(self)
obj.__init__(
url,
version,
xml,
parse_remote_metadata,
timeout,
headers=headers,
username=username,
password=password,
auth=auth,
)
return obj

def __getitem__(self, name):
""" check contents dictionary to allow dict like access to service layers"""
if name in list(self.__getattribute__("contents").keys()):
Expand Down
42 changes: 0 additions & 42 deletions owslib/feature/wfs110.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,48 +56,6 @@ class WebFeatureService_1_1_0(WebFeatureService_):

Implements IWebFeatureService.
"""

def __new__(
self,
url,
version,
xml,
parse_remote_metadata=False,
timeout=30,
headers=None,
username=None,
password=None,
auth=None,
):
""" overridden __new__ method

@type url: string
@param url: url of WFS capabilities document
@type xml: string
@param xml: elementtree object
@type parse_remote_metadata: boolean
@param parse_remote_metadata: whether to fully process MetadataURL elements
@param headers: HTTP headers to send with requests
@param timeout: time (in seconds) after which requests should timeout
@param username: service authentication username
@param password: service authentication password
@param auth: instance of owslib.util.Authentication
@return: initialized WebFeatureService_1_1_0 object
"""
obj = object.__new__(self)
obj.__init__(
url,
version,
xml,
parse_remote_metadata,
timeout,
headers=headers,
username=username,
password=password,
auth=auth,
)
return obj

def __getitem__(self, name):
""" check contents dictionary to allow dict like access to service layers"""
if name in list(self.__getattribute__("contents").keys()):
Expand Down
42 changes: 0 additions & 42 deletions owslib/feature/wfs200.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,48 +45,6 @@ class WebFeatureService_2_0_0(WebFeatureService_):

Implements IWebFeatureService.
"""

def __new__(
self,
url,
version,
xml,
parse_remote_metadata=False,
timeout=30,
headers=None,
username=None,
password=None,
auth=None,
):
""" overridden __new__ method

@type url: string
@param url: url of WFS capabilities document
@type xml: string
@param xml: elementtree object
@type parse_remote_metadata: boolean
@param parse_remote_metadata: whether to fully process MetadataURL elements
@param headers: HTTP headers to send with requests
@param timeout: time (in seconds) after which requests should timeout
@param username: service authentication username
@param password: service authentication password
@param auth: instance of owslib.util.Authentication
@return: initialized WebFeatureService_2_0_0 object
"""
obj = object.__new__(self)
obj.__init__(
url,
version,
xml,
parse_remote_metadata,
timeout,
headers=headers,
username=username,
password=password,
auth=auth,
)
return obj

def __getitem__(self, name):
""" check contents dictionary to allow dict like access to service layers"""
if name in list(self.__getattribute__("contents").keys()):
Expand Down