From 4b9b7cf1fa00216bd6e0738b6ccf8f5999d26c2e Mon Sep 17 00:00:00 2001 From: Vincent Fazio Date: Mon, 7 Jan 2019 11:14:57 +1100 Subject: [PATCH] Strip out redundant __new__ to enable object pickling --- owslib/feature/wfs100.py | 42 ---------------------------------------- owslib/feature/wfs110.py | 42 ---------------------------------------- owslib/feature/wfs200.py | 42 ---------------------------------------- 3 files changed, 126 deletions(-) diff --git a/owslib/feature/wfs100.py b/owslib/feature/wfs100.py index f3c8ca04..ee012d94 100644 --- a/owslib/feature/wfs100.py +++ b/owslib/feature/wfs100.py @@ -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()): diff --git a/owslib/feature/wfs110.py b/owslib/feature/wfs110.py index 882ceaab..5bf84c23 100644 --- a/owslib/feature/wfs110.py +++ b/owslib/feature/wfs110.py @@ -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()): diff --git a/owslib/feature/wfs200.py b/owslib/feature/wfs200.py index 3825da2a..d1133bb9 100644 --- a/owslib/feature/wfs200.py +++ b/owslib/feature/wfs200.py @@ -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()):