Merge branch 'main' of https://git.dianaband.info/doohoyi/distribusi-foh000 into main
This commit is contained in:
commit
93769a5069
2 changed files with 17 additions and 9 deletions
|
|
@ -26,6 +26,15 @@ ignore = Ignore()
|
|||
PATTERN_TAG = re.compile(r"(?P<name>.+?)(?P<tags>\#.+)*\.(?P<ext>.{1,4}$)")
|
||||
PATTERN_TAG_FOLDER = re.compile(r"(?P<name>.+?)(?P<tags>\#.+)\/(?P<file>.+)")
|
||||
|
||||
def untag(name):
|
||||
m = PATTERN_TAG.search(name)
|
||||
if m:
|
||||
file_name = m.group('name')
|
||||
file_ext = m.group('ext')
|
||||
return (file_name + "." + file_ext)
|
||||
else:
|
||||
return name
|
||||
|
||||
def caption(image):
|
||||
try:
|
||||
process = subprocess.Popen(
|
||||
|
|
@ -78,7 +87,7 @@ def thumbnail(image, name, args):
|
|||
if args.captions:
|
||||
cap = caption(image)
|
||||
else:
|
||||
cap = name
|
||||
cap = untag(name)
|
||||
|
||||
m = PATTERN_TAG_FOLDER.search(cap)
|
||||
if m:
|
||||
|
|
@ -107,11 +116,7 @@ def div(args, type_, subtype, tag, name, fid):
|
|||
|
||||
|
||||
|
||||
m = PATTERN_TAG.search(name)
|
||||
if m:
|
||||
file_name = m.group('name')
|
||||
file_ext = m.group('ext')
|
||||
name = file_name + "." + file_ext
|
||||
name = untag(name)
|
||||
|
||||
if args.no_filenames:
|
||||
filename = ''
|
||||
|
|
@ -231,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 = ''
|
||||
|
|
@ -345,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 = ''
|
||||
|
|
@ -353,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)
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ participants.html
|
|||
style.css
|
||||
404.html
|
||||
main.js
|
||||
.+.alt
|
||||
.+\.alt$
|
||||
events
|
||||
여기에_대해_about_here
|
||||
어떤_파일을_넣을까
|
||||
|
|
|
|||
Loading…
Reference in a new issue