X-Git-Url: https://git.phdru.name/?p=m_librarian.git;a=blobdiff_plain;f=m_librarian%2Fdownload.py;h=f1a41c76d40243908f8f975557696d246f902b1a;hp=6304658062b79bf2ef68a3550c2981d44eb094e2;hb=0b2332ea91caea2de3115b873762e71637ab2932;hpb=ecd2349c26418c8b55ec9e0d17009321b6472236 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)