From 0b2332ea91caea2de3115b873762e71637ab2932 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Mon, 11 Jun 2018 02:22:21 +0300 Subject: [PATCH] Fix(download:format): Fix compile_format --- m_librarian/download.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/m_librarian/download.py b/m_librarian/download.py index 6304658..f1a41c7 100755 --- a/m_librarian/download.py +++ b/m_librarian/download.py @@ -17,11 +17,12 @@ compiled_format = '%(file)s' def _compile_format(): global format, compile_format, compiled_format - if compile_format: - compile_format = False - format = get_config().get('download', 'format') - if not format: - return + if not compile_format: + return + compile_format = False + format = get_config().get('download', 'format') + if not format: + return got_percent = False compiled = [] for c in format: @@ -72,8 +73,8 @@ def download(book, dest_path=None, lib_path=None, a_format=None): global format, compile_format, compiled_format if a_format: - format = a_format compile_format = True + format = a_format _compile_format() if compiled_format[-1] in ('\0', '\\', '/'): raise ValueError('Bad format: "%s"' % compiled_format) -- 2.39.5