Skip to content

Commit

Permalink
Backend: remove unused verify arg.
Browse files Browse the repository at this point in the history
This was used for the https server option which has been reverted.
  • Loading branch information
wrohdewald committed Aug 19, 2018
1 parent bdf05ac commit 0396205
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
4 changes: 1 addition & 3 deletions gpxity/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ class Backend:
Every implementation may define its own default for url.
timeout: If None, there are no timeouts: Gpxity waits forever. For legal values
see http://docs.python-requests.org/en/master/user/advanced/#timeouts
verify: True, False or the name of a local cert file
config: A dict with all entries in auth.cfg for this backend
Expand Down Expand Up @@ -101,7 +100,7 @@ class BackendException(Exception):
# cookie "SERVERID".
_session = dict()

def __init__(self, url: str = None, auth=None, cleanup: bool = False, timeout=None, verify=True):
def __init__(self, url: str = None, auth=None, cleanup: bool = False, timeout=None):
"""See class docstring."""
self._decoupled = False
super(Backend, self).__init__()
Expand All @@ -123,7 +122,6 @@ def __init__(self, url: str = None, auth=None, cleanup: bool = False, timeout=No
self.__match = None
self.logger = logging.getLogger(self.identifier())
self.timeout = timeout
self.verify = verify
self._current_track = None

def identifier(self, track=None) ->str:
Expand Down
4 changes: 2 additions & 2 deletions gpxity/backends/mailer.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ class Mailer(Backend): # pylint: disable=abstract-method

id_count = 0

def __init__(self, url=None, auth=None, cleanup=False, timeout=None, verify=True):
def __init__(self, url=None, auth=None, cleanup=False, timeout=None):
"""See class docstring."""
super(Mailer, self).__init__(url, auth, cleanup, timeout, verify)
super(Mailer, self).__init__(url, auth, cleanup, timeout)
if self.url.endswith('/'):
self.url = self.url[:-1]
self.history = list()
Expand Down
11 changes: 5 additions & 6 deletions gpxity/backends/mmt.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ class MMT(Backend):
user account.
timeout: If None, there are no timeouts: Gpxity waits forever. For legal values
see http://docs.python-requests.org/en/master/user/advanced/#timeouts
verify: True, False or the name of a local cert file
"""

Expand Down Expand Up @@ -235,11 +234,11 @@ class MMT(Backend):
# every MMT account only gets one.
_current_lifetrack = None

def __init__(self, url=None, auth=None, cleanup=False, timeout=None, verify=True):
def __init__(self, url=None, auth=None, cleanup=False, timeout=None):
"""See class docstring."""
if url is None:
url = self.default_url
super(MMT, self).__init__(url, auth, cleanup, timeout, verify)
super(MMT, self).__init__(url, auth, cleanup, timeout)
self.__mid = -1 # member id at MMT for auth
self.__is_free_account = None
self.__tag_ids = dict() # key: tag name, value: tag id in MMT. It seems that MMT
Expand Down Expand Up @@ -278,7 +277,7 @@ def session(self):
payload = {'username': self.auth[0], 'password': self.auth[1], 'ACT': '9'}
login_url = '{}/login'.format(self.https_url)
response = self._session[ident].post(
login_url, data=payload, timeout=self.timeout, verify=self.verify)
login_url, data=payload, timeout=self.timeout)
if 'You are now logged in.' not in response.text:
raise self.BackendException('Login as {} failed'.format(self.auth[0]))
cookies = requests.utils.dict_from_cookiejar(self._session[ident].cookies)
Expand Down Expand Up @@ -386,10 +385,10 @@ def __post(
try:
if with_session:
response = self.session.post(
full_url, data=data, headers=headers, timeout=self.timeout, verify=self.verify)
full_url, data=data, headers=headers, timeout=self.timeout)
else:
response = requests.post(
full_url, data=data, headers=headers, auth=self.auth, timeout=self.timeout, verify=self.verify)
full_url, data=data, headers=headers, auth=self.auth, timeout=self.timeout)
except requests.exceptions.ReadTimeout:
self.logger.error('%s: timeout for %s', self.identifier(), data)
raise
Expand Down

0 comments on commit 0396205

Please sign in to comment.