change alt path

This commit is contained in:
Sewon Ahn 2021-09-16 00:36:52 +09:00
parent 9184127623
commit 3add64f558

View file

@ -236,7 +236,8 @@ def render_dir(args, directory):
c = caption(relative_path)
a = FILE_TYPES[type_].format(quote(relative_path), c, c)
# ALT 처리
alt_path = full_path + ".alt"
src = os.path.splitext(full_path)
alt_path = src[0] + ".alt"
if os.path.isfile(alt_path):
f = open(alt_path, 'r', encoding='utf-8')
alt = ''
@ -350,7 +351,8 @@ def distribusify(args, directory, freg): # noqa
c = caption(full_path)
a = FILE_TYPES[type_].format(quote(name), c, c)
# ALT 처리
alt_path = full_path + ".alt"
src = os.path.splitext(full_path)
alt_path = src[0] + ".alt"
if os.path.isfile(alt_path):
f = open(alt_path, 'r', encoding='utf-8')
alt = ''
@ -358,6 +360,7 @@ def distribusify(args, directory, freg): # noqa
line = f.readline()
if not line: break
alt = alt + line + ' '
print("alt: " + alt )
a = FILE_TYPES[type_].format(quote(name), alt, c)