urlencoding .. more changes

This commit is contained in:
Dooho Yi 2021-09-14 01:29:33 +09:00
parent eb1d85ad6b
commit 085be22302

View file

@ -201,7 +201,7 @@ def render_dir(args, directory):
print('Found file in dir ', name, 'as', mime) print('Found file in dir ', name, 'as', mime)
if type_ in FILE_TYPES: if type_ in FILE_TYPES:
a = FILE_TYPES[type_].format(relative_path, c, c) a = FILE_TYPES[type_].format(quote(relative_path), c, c)
# expansion for different kind of text files # expansion for different kind of text files
if type_ == 'text': if type_ == 'text':
@ -222,14 +222,14 @@ def render_dir(args, directory):
# a = FILE_TYPES[type_] # a = FILE_TYPES[type_]
if type_ == 'image': if type_ == 'image':
a = FILE_TYPES[type_].format(relative_path, c, c) a = FILE_TYPES[type_].format(quote(relative_path), c, c)
if args.thumbnail: if args.thumbnail:
a = thumbnail(full_path, relative_path, args) a = thumbnail(full_path, relative_path, args)
if args.no_filenames: if args.no_filenames:
c = "" c = ""
if args.captions: if args.captions:
c = caption(relative_path) c = caption(relative_path)
a = FILE_TYPES[type_].format(relative_path, c, c) a = FILE_TYPES[type_].format(quote(relative_path), c, c)
# ALT 처리 # ALT 처리
alt_path = full_path + ".alt" alt_path = full_path + ".alt"
if os.path.isfile(alt_path): if os.path.isfile(alt_path):
@ -240,7 +240,7 @@ def render_dir(args, directory):
if not line: break if not line: break
alt = alt + line + ' ' alt = alt + line + ' '
a = FILE_TYPES[type_].format(relative_path, alt, c) a = FILE_TYPES[type_].format(quote(relative_path), alt, c)
if subtype in SUB_TYPES: if subtype in SUB_TYPES:
a = SUB_TYPES[subtype] a = SUB_TYPES[subtype]
@ -314,7 +314,7 @@ def distribusify(args, directory, freg): # noqa
if type_ in FILE_TYPES: if type_ in FILE_TYPES:
a = FILE_TYPES[type_].format(name, c, c) a = FILE_TYPES[type_].format(quote(name), c, c)
# expansion for different kind of text files # expansion for different kind of text files
if type_ == 'text': if type_ == 'text':
@ -341,7 +341,7 @@ def distribusify(args, directory, freg): # noqa
c = "" c = ""
if args.captions: if args.captions:
c = caption(full_path) c = caption(full_path)
a = FILE_TYPES[type_].format(name, c, c) a = FILE_TYPES[type_].format(quote(name), c, c)
# ALT 처리 # ALT 처리
alt_path = full_path + ".alt" alt_path = full_path + ".alt"
if os.path.isfile(alt_path): if os.path.isfile(alt_path):
@ -352,7 +352,7 @@ def distribusify(args, directory, freg): # noqa
if not line: break if not line: break
alt = alt + line + ' ' alt = alt + line + ' '
a = FILE_TYPES[type_].format(name, alt, c) a = FILE_TYPES[type_].format(quote(name), alt, c)
if subtype in SUB_TYPES: if subtype in SUB_TYPES:
a = SUB_TYPES[subtype] a = SUB_TYPES[subtype]