openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #25600
[Bug 1410693] [NEW] Code duplication in check_latest_version
Public bug reported:
check_latest_version in core.utils.__init__.py duplicates code to
download and retry on failure of the version check file. This code is
similar to the code in get_webpage. We could reduce duplication by using
get_webpage
Duplicate code:
retries = 0
while True:
try:
remote_version = str(urllib.request.urlopen(req, None,
timeout=CONNECTION_TIMEOUT).read().decode()).strip()
except ConnectionException:
if retries > CONNECTION_RETRIES:
log.exception('Failed to download the latest OpenLP version file')
else:
retries += 1
time.sleep(0.1)
continue
break
** Affects: openlp
Importance: Wishlist
Status: New
** Changed in: openlp
Importance: Undecided => Wishlist
--
You received this bug notification because you are a member of OpenLP
Core, which is subscribed to OpenLP.
https://bugs.launchpad.net/bugs/1410693
Title:
Code duplication in check_latest_version
Status in OpenLP - Worship Presentation Software:
New
Bug description:
check_latest_version in core.utils.__init__.py duplicates code to
download and retry on failure of the version check file. This code is
similar to the code in get_webpage. We could reduce duplication by
using get_webpage
Duplicate code:
retries = 0
while True:
try:
remote_version = str(urllib.request.urlopen(req, None,
timeout=CONNECTION_TIMEOUT).read().decode()).strip()
except ConnectionException:
if retries > CONNECTION_RETRIES:
log.exception('Failed to download the latest OpenLP version file')
else:
retries += 1
time.sleep(0.1)
continue
break
To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1410693/+subscriptions
Follow ups
-
[Bug 1410693] Re: Code duplication in check_latest_version
From: Phill, 2017-10-09
-
[Bug 1410693] Re: Code duplication in check_latest_version
From: Tim Bentley, 2017-06-17
-
[Bug 1410693] Re: Code duplication in check_latest_version
From: Tim Bentley, 2017-06-17
-
[Bug 1410693] Re: Code duplication in check_latest_version
From: Tim Bentley, 2015-04-28
-
[Bug 1410693] Re: Code duplication in check_latest_version
From: Phill, 2015-04-28
-
[Bug 1410693] Re: Code duplication in check_latest_version
From: Ken Roberts, 2015-01-20
-
[Bug 1410693] Re: Code duplication in check_latest_version
From: Ken Roberts, 2015-01-20
-
[Bug 1410693] Re: Code duplication in check_latest_version
From: Phill, 2015-01-19
-
[Bug 1410693] Re: Code duplication in check_latest_version
From: Ken Roberts, 2015-01-19
-
[Bug 1410693] [NEW] Code duplication in check_latest_version
From: Phill, 2015-01-14
References