Made kiwix-resources work with python 3.5-

Formatted string literals appeared in Python 3.6. Some CI platforms
still use older versions of Python.
This commit is contained in:
Veloman Yunkan 2022-02-27 20:46:48 +04:00
parent 707df3d10b
commit 42fd6e8926
1 changed files with 2 additions and 2 deletions

View File

@ -50,7 +50,7 @@ def set_cacheid(resource_matchobj):
resource = 'skin/' + resource_matchobj.group(3) resource = 'skin/' + resource_matchobj.group(3)
extra_query = resource_matchobj.group(4) extra_query = resource_matchobj.group(4)
cacheid = 'cacheid=' + resource_revisions[resource] cacheid = 'cacheid=' + resource_revisions[resource]
return f'{path}?{cacheid}{extra_query}' return path + '?' + cacheid + extra_query
def preprocess_line(line): def preprocess_line(line):
if 'KIWIXCACHEID' in line: if 'KIWIXCACHEID' in line:
@ -82,7 +82,7 @@ def symlink_resource(src, resource_path):
os.symlink(src, resource_path) os.symlink(src, resource_path)
def preprocess_resource(srcdir, resource_path, outdir): def preprocess_resource(srcdir, resource_path, outdir):
print(f'Preprocessing {resource_path}...') print('Preprocessing', resource_path, '...')
resource_dir = os.path.dirname(resource_path) resource_dir = os.path.dirname(resource_path)
if resource_dir != '': if resource_dir != '':
os.makedirs(os.path.join(outdir, resource_dir), exist_ok=True) os.makedirs(os.path.join(outdir, resource_dir), exist_ok=True)