From: Oleg Broytman Date: Sun, 10 Jun 2018 23:22:21 +0000 (+0300) Subject: Fix(download:format): Fix compile_format X-Git-Tag: 0.1.4~9 X-Git-Url: https://git.phdru.name/?p=m_librarian.git;a=commitdiff_plain;h=0b2332ea91caea2de3115b873762e71637ab2932 Fix(download:format): Fix compile_format --- 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)