From 292861907ef944e14bf620c52997b118cf9c056f Mon Sep 17 00:00:00 2001 From: Philip Ridout Date: Wed, 6 Sep 2017 21:18:08 +0100 Subject: [PATCH] minor edits --- openlp/core/common/applocation.py | 1 - openlp/core/common/httputils.py | 4 ++-- openlp/core/common/languagemanager.py | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/openlp/core/common/applocation.py b/openlp/core/common/applocation.py index 87ef7e6c1..02a872303 100644 --- a/openlp/core/common/applocation.py +++ b/openlp/core/common/applocation.py @@ -29,7 +29,6 @@ import sys from openlp.core.common import Settings, is_win, is_macosx from openlp.core.common.path import Path - if not is_win() and not is_macosx(): try: from xdg import BaseDirectory diff --git a/openlp/core/common/httputils.py b/openlp/core/common/httputils.py index 9f95f4924..90e128063 100644 --- a/openlp/core/common/httputils.py +++ b/openlp/core/common/httputils.py @@ -218,10 +218,10 @@ def url_get_file(callback, url, f_path, sha256=None): block_size = 4096 retries = 0 log.debug("url_get_file: " + url) - if sha256: - hasher = hashlib.sha256() while True: try: + if sha256: + hasher = hashlib.sha256() with f_path.open('wb') as file: url_file = urllib.request.urlopen(url, timeout=CONNECTION_TIMEOUT) # Download until finished or canceled. diff --git a/openlp/core/common/languagemanager.py b/openlp/core/common/languagemanager.py index 35b195031..40e4930fb 100644 --- a/openlp/core/common/languagemanager.py +++ b/openlp/core/common/languagemanager.py @@ -141,7 +141,7 @@ class LanguageManager(object): if reg_ex.exactMatch(qmf): name = '{regex}'.format(regex=reg_ex.cap(1)) LanguageManager.__qm_list__[ - '{count:>2i} {name}'.format(count=counter + 1, name=LanguageManager.language_name(qmf))] = name + '{count:>2d} {name}'.format(count=counter + 1, name=LanguageManager.language_name(qmf))] = name @staticmethod def get_qm_list():