From 91c179eaeaa0755dbc2d24e0a605188f4d5aab79 Mon Sep 17 00:00:00 2001 From: make-ing Date: Fri, 27 Oct 2017 15:21:01 +0200 Subject: [PATCH] fixed 1.3.5 merge conflict. --- .../version_checks/bitbucket_commit.py | 26 ------------------- 1 file changed, 26 deletions(-) diff --git a/src/octoprint/plugins/softwareupdate/version_checks/bitbucket_commit.py b/src/octoprint/plugins/softwareupdate/version_checks/bitbucket_commit.py index b40f2c5809..bc79eda712 100644 --- a/src/octoprint/plugins/softwareupdate/version_checks/bitbucket_commit.py +++ b/src/octoprint/plugins/softwareupdate/version_checks/bitbucket_commit.py @@ -7,11 +7,6 @@ import requests import logging import base64 -<<<<<<< HEAD - -from ..exceptions import ConfigurationInvalid -======= ->>>>>>> 77753ca02602d3a798d6b0a22535e6fd69ff448a BRANCH_HEAD_URL = "https://api.bitbucket.org/2.0/repositories/{user}/{repo}/commit/{branch}" @@ -19,14 +14,6 @@ def _get_latest_commit(user, repo, branch, api_user=None, api_password=None): -<<<<<<< HEAD - url = BRANCH_HEAD_URL.format(user=user, repo=repo, branch=branch) - headers = {} - if api_user is not None and api_password is not None: - headers['authorization'] = 'Basic {}'.format( - base64.b64encode(b"{user}:{pw}".format(user=api_user, pw=api_password))) - r = requests.get(url, headers=headers) -======= from ..exceptions import NetworkError url = BRANCH_HEAD_URL.format(user=user, repo=repo, branch=branch) @@ -39,7 +26,6 @@ def _get_latest_commit(user, repo, branch, api_user=None, api_password=None): r = requests.get(url, headers=headers, timeout=(3.05, 30)) except requests.ConnectionError as exc: raise NetworkError(cause=exc) ->>>>>>> 77753ca02602d3a798d6b0a22535e6fd69ff448a if not r.status_code == requests.codes.ok: return None @@ -61,21 +47,10 @@ def get_latest(target, check, online=True): if "branch" in check and check["branch"] is not None: branch = check["branch"] -<<<<<<< HEAD - api_user = check["api_user"] if 'api_user' in check else None - api_password = check["api_password"] if 'api_password' in check else None - - current = None - if "current" in check: - current = check["current"] - - remote_commit = _get_latest_commit(check["user"], check["repo"], branch, api_user, api_password) -======= api_user = check.get("api_user") api_password = check.get("api_password") current = check.get("current") ->>>>>>> 77753ca02602d3a798d6b0a22535e6fd69ff448a information = dict( local=dict(name="Commit {commit}".format(commit=current if current is not None else "unknown"), value=current), @@ -94,4 +69,3 @@ def get_latest(target, check, online=True): logger.debug("Target: %s, local: %s, remote: %s" % (target, current, remote_commit)) return information, is_current -