Skip to content

Commit

Permalink
Strip out redundant __new__ to enable object pickling
Browse files Browse the repository at this point in the history
  • Loading branch information
vjf committed Jan 7, 2019
1 parent 60270c9 commit d7dc8e0
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 60 deletions.
20 changes: 0 additions & 20 deletions owslib/feature/wfs100.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,26 +61,6 @@ class WebFeatureService_1_0_0(object):
Implements IWebFeatureService.
"""
def __new__(self,url, version, xml, parse_remote_metadata=False, timeout=30,
username=None, password=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 timeout: time (in seconds) after which requests should timeout
@param username: service authentication username
@param password: service authentication password
@return: initialized WebFeatureService_1_0_0 object
"""
obj=object.__new__(self)
obj.__init__(url, version, xml, parse_remote_metadata, timeout,
username=username, password=password)
return obj

def __getitem__(self,name):
''' check contents dictionary to allow dict like access to service layers'''
if name in self.__getattribute__('contents').keys():
Expand Down
20 changes: 0 additions & 20 deletions owslib/feature/wfs110.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,26 +39,6 @@ class WebFeatureService_1_1_0(WebFeatureService_):
Implements IWebFeatureService.
"""
def __new__(self,url, version, xml, parse_remote_metadata=False, timeout=30,
username=None, password=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 timeout: time (in seconds) after which requests should timeout
@param username: service authentication username
@param password: service authentication password
@return: initialized WebFeatureService_1_1_0 object
"""
obj=object.__new__(self)
obj.__init__(url, version, xml, parse_remote_metadata, timeout,
username=username, password=password)
return obj

def __getitem__(self,name):
''' check contents dictionary to allow dict like access to service layers'''
if name in self.__getattribute__('contents').keys():
Expand Down
20 changes: 0 additions & 20 deletions owslib/feature/wfs200.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,26 +49,6 @@ class WebFeatureService_2_0_0(WebFeatureService_):
Implements IWebFeatureService.
"""
def __new__(self,url, version, xml, parse_remote_metadata=False, timeout=30,
username=None, password=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 timeout: time (in seconds) after which requests should timeout
@param username: service authentication username
@param password: service authentication password
@return: initialized WebFeatureService_2_0_0 object
"""
obj=object.__new__(self)
obj.__init__(url, version, xml, parse_remote_metadata, timeout,
username=username, password=password)
return obj

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

0 comments on commit d7dc8e0

Please sign in to comment.