Update ignore system
This commit is contained in:
parent
f5faf0f011
commit
f425abf790
15 changed files with 40 additions and 385 deletions
|
|
@ -11,8 +11,7 @@ from PIL import Image, ExifTags
|
|||
import markdown
|
||||
|
||||
from distribusi.page_template import html_footer, html_head
|
||||
from distribusi.page_template_event import html_footer_evnet, html_head_event
|
||||
from distribusi.page_template_events import html_footer_events, html_head_event
|
||||
from distribusi.page_template_event import html_footer_event, html_head_event
|
||||
from distribusi.mappings import CODE_TYPES, FILE_TYPES, SUB_TYPES
|
||||
from distribusi import fragments
|
||||
import uuid
|
||||
|
|
@ -132,13 +131,14 @@ def check_distribusi_index(args, index):
|
|||
elif args.force:
|
||||
return True
|
||||
|
||||
def write_index(args,index, html, html_head, html_footer):
|
||||
|
||||
def write_index(args, index, html, html_head, html_footer):
|
||||
with open(index, 'w') as f:
|
||||
if not args.no_template:
|
||||
if args.style:
|
||||
fs = open(args.style, "r")
|
||||
style = fs.read()
|
||||
styled_html_head = html_head# % style
|
||||
styled_html_head = html_head # % style
|
||||
else:
|
||||
styled_html_head = html_head % ''
|
||||
print("---")
|
||||
|
|
@ -162,7 +162,7 @@ def render_dir(args, directory):
|
|||
relative_path = "./{}/{}".format(relative, name)
|
||||
|
||||
if ignore.test(name):
|
||||
pass
|
||||
continue
|
||||
elif 'index.html' not in name:
|
||||
full_path = os.path.join(root, name)
|
||||
mime = MIME_TYPE.from_file(full_path)
|
||||
|
|
@ -239,6 +239,8 @@ def render_dir(args, directory):
|
|||
def distribusify(args, directory, freg): # noqa
|
||||
for root, dirs, files in os.walk(directory):
|
||||
ignore.add(root)
|
||||
if ignore.testRoot(root):
|
||||
continue
|
||||
|
||||
if args.exclude_directory:
|
||||
if args.verbose:
|
||||
|
|
@ -256,10 +258,14 @@ def distribusify(args, directory, freg): # noqa
|
|||
# fragments index
|
||||
# 작가 폴더 내인 경우 아티스트명 저장
|
||||
#
|
||||
artist = None
|
||||
path = root.split('/')
|
||||
if len(path) == 3:
|
||||
if len(path) > 2:
|
||||
artist = path[2].strip()
|
||||
|
||||
print(path)
|
||||
print(artist)
|
||||
|
||||
if not args.remove_index:
|
||||
html = []
|
||||
|
||||
|
|
@ -268,7 +274,7 @@ def distribusify(args, directory, freg): # noqa
|
|||
|
||||
for name in sorted(files):
|
||||
if ignore.test(name):
|
||||
pass
|
||||
continue
|
||||
elif 'index.html' not in name:
|
||||
full_path = os.path.join(root, name)
|
||||
mime = MIME_TYPE.from_file(full_path)
|
||||
|
|
@ -322,8 +328,6 @@ def distribusify(args, directory, freg): # noqa
|
|||
|
||||
a = FILE_TYPES[type_].format(name, alt, c)
|
||||
|
||||
|
||||
|
||||
if subtype in SUB_TYPES:
|
||||
a = SUB_TYPES[subtype]
|
||||
|
||||
|
|
@ -340,7 +344,6 @@ def distribusify(args, directory, freg): # noqa
|
|||
fid = freg.get_index(artist, name)
|
||||
html.append(div(args, type_, subtype, a, name, fid))
|
||||
|
||||
|
||||
if root != directory:
|
||||
if args.menu_with_index:
|
||||
html.append('<a href="../index.html">../</a>')
|
||||
|
|
@ -349,9 +352,8 @@ def distribusify(args, directory, freg): # noqa
|
|||
|
||||
for name in dirs:
|
||||
if ignore.test(name):
|
||||
pass
|
||||
elif len(path) == 3 and artist:
|
||||
print(artist)
|
||||
continue
|
||||
elif (len(path) == 3 and artist) or (len(path) == 4 and artist == "events"):
|
||||
# dirs 내부의 콘텐츠를 렌더링해 가져와야 함
|
||||
fid = freg.get_index(artist, name)
|
||||
rd = render_dir(args, "{}/{}".format(root, name))
|
||||
|
|
@ -363,9 +365,15 @@ def distribusify(args, directory, freg): # noqa
|
|||
index = os.path.join(root, 'index.html')
|
||||
if os.path.exists(index):
|
||||
if check_distribusi_index(args, index):
|
||||
write_index(args,index,html, html_head, html_footer)
|
||||
if artist == "events":
|
||||
write_index(args, index, html, html_head_event, html_footer_event)
|
||||
else:
|
||||
write_index(args, index, html, html_head, html_footer)
|
||||
elif not os.path.exists(index):
|
||||
write_index(args,index,html, html_head, html_footer)
|
||||
if artist == "events":
|
||||
write_index(args, index, html, html_head_event, html_footer_event)
|
||||
else:
|
||||
write_index(args, index, html, html_head, html_footer)
|
||||
|
||||
if args.remove_index:
|
||||
index = os.path.join(root, 'index.html')
|
||||
|
|
|
|||
|
|
@ -26,3 +26,16 @@ class Ignore:
|
|||
return True
|
||||
|
||||
return False
|
||||
|
||||
def testRoot(self, target):
|
||||
path = target.split('/')
|
||||
|
||||
if path[len(path)-1] in self.ignore or path[len(path)-1] == "":
|
||||
return True
|
||||
|
||||
for ig in self.ignore:
|
||||
reg = re.compile(ig)
|
||||
if bool(re.match(reg, target)):
|
||||
return True
|
||||
|
||||
return False
|
||||
|
|
@ -12,7 +12,7 @@ html_head_event = """
|
|||
<meta name="generator" content="distribusi" />
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
%s
|
||||
<link rel="stylesheet" type="text/css" href="/src/style/common.css" />
|
||||
<link rel="stylesheet" type="text/css" href="/src/style/event.css" />
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
|
||||
|
|
|
|||
|
|
@ -6,8 +6,10 @@ index.html
|
|||
index.json
|
||||
Readme.md
|
||||
src
|
||||
.+/src+.
|
||||
participants.html
|
||||
style.css
|
||||
404.html
|
||||
main.js
|
||||
.+.alt
|
||||
events
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"occupation": 0
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 29 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 42 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 48 KiB |
|
|
@ -1,74 +0,0 @@
|
|||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<!-- Generated with distribusi https://git.vvvvvvaria.org/varia/distribusi -->
|
||||
<meta name="generator" content="distribusi" />
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="./style.css" />
|
||||
<link rel="stylesheet" type="text/css" href="/src/style/common.css" />
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
|
||||
<script src="/src/scripts/mobileScroll.js"></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div>
|
||||
<div id="menu">
|
||||
<div id="logo_wrapper" class="svg_wrapper">
|
||||
<a href="/index.html">
|
||||
<img id="logo_foh"src="/src/img/logo.svg" alt="환대의 조각 로고">
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<span id="to_about">
|
||||
<a href="/about.html">
|
||||
ABOUT
|
||||
</a>
|
||||
</span>
|
||||
<span id="to_fragments">
|
||||
<a href="/participants.html">
|
||||
FRAGMENTS
|
||||
</a>
|
||||
</span>
|
||||
<span id="to_timeline">
|
||||
<a href="#">
|
||||
TIMELINE
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div id="margin">
|
||||
<!-- to avoid overlapping -->
|
||||
</div>
|
||||
|
||||
<div id="wrapper_author">
|
||||
<div id="fragment_wrapper">
|
||||
</div>
|
||||
<div id="introduction">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="archive_exit" style="display:none;"></div>
|
||||
<div id="archive">
|
||||
<button id="archive_button">ARCHIVE
|
||||
<!-- <img id="icon_archive_more" src="src/img/icon_timeline.svg" alt=""> -->
|
||||
</button>
|
||||
<div id="archive_list">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="contents">
|
||||
<div id="frags">
|
||||
<a href="../">../</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="/src/scripts/updateIntroduction.js"></script>
|
||||
<script src="/src/scripts/updateArchive.js"></script>
|
||||
<script src="/src/scripts/hashEvent.js"></script>
|
||||
<script src="/src/scripts/mobileArchiveEvent.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"occupation": 1
|
||||
}
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
이벤트 0001 에 대한 설명문
|
||||
이벤트 0001 에 대한 설명문
|
||||
이벤트 0001 에 대한 설명문
|
||||
이벤트 0001 에 대한 설명문
|
||||
이벤트 0001 에 대한 설명문
|
||||
이벤트 0001 에 대한 설명문
|
||||
이벤트 0001 에 대한 설명문
|
||||
이벤트 0001 에 대한 설명문
|
||||
이벤트 0001 에 대한 설명문
|
||||
이벤트 0001 에 대한 설명문
|
||||
이벤트 0001 에 대한 설명문
|
||||
이벤트 0001 에 대한 설명문
|
||||
이벤트 0001 에 대한 설명문
|
||||
이벤트 0001 에 대한 설명문
|
||||
이벤트 0001 에 대한 설명문
|
||||
이벤트 0001 에 대한 설명문
|
||||
이벤트 0001 에 대한 설명문
|
||||
이벤트 0001 에 대한 설명문
|
||||
이벤트 0001 에 대한 설명문
|
||||
이벤트 0001 에 대한 설명문
|
||||
이벤트 0001 에 대한 설명문
|
||||
이벤트 0001 에 대한 설명문
|
||||
이벤트 0001 에 대한 설명문
|
||||
이벤트 0001 에 대한 설명문
|
||||
|
||||
|
||||
|
|
@ -1,74 +0,0 @@
|
|||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<!-- Generated with distribusi https://git.vvvvvvaria.org/varia/distribusi -->
|
||||
<meta name="generator" content="distribusi" />
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="./style.css" />
|
||||
<link rel="stylesheet" type="text/css" href="/src/style/common.css" />
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
|
||||
<script src="/src/scripts/mobileScroll.js"></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div>
|
||||
<div id="menu">
|
||||
<div id="logo_wrapper" class="svg_wrapper">
|
||||
<a href="/index.html">
|
||||
<img id="logo_foh"src="/src/img/logo.svg" alt="환대의 조각 로고">
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<span id="to_about">
|
||||
<a href="/about.html">
|
||||
ABOUT
|
||||
</a>
|
||||
</span>
|
||||
<span id="to_fragments">
|
||||
<a href="/participants.html">
|
||||
FRAGMENTS
|
||||
</a>
|
||||
</span>
|
||||
<span id="to_timeline">
|
||||
<a href="#">
|
||||
TIMELINE
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div id="margin">
|
||||
<!-- to avoid overlapping -->
|
||||
</div>
|
||||
|
||||
<div id="wrapper_author">
|
||||
<div id="fragment_wrapper">
|
||||
</div>
|
||||
<div id="introduction">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="archive_exit" style="display:none;"></div>
|
||||
<div id="archive">
|
||||
<button id="archive_button">ARCHIVE
|
||||
<!-- <img id="icon_archive_more" src="src/img/icon_timeline.svg" alt=""> -->
|
||||
</button>
|
||||
<div id="archive_list">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="contents">
|
||||
<div id="frags">
|
||||
<a href="../">../</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="/src/scripts/updateIntroduction.js"></script>
|
||||
<script src="/src/scripts/updateArchive.js"></script>
|
||||
<script src="/src/scripts/hashEvent.js"></script>
|
||||
<script src="/src/scripts/mobileArchiveEvent.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,110 +0,0 @@
|
|||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<!-- Generated with distribusi https://git.vvvvvvaria.org/varia/distribusi -->
|
||||
<meta name="generator" content="distribusi" />
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="./style.css" />
|
||||
<link rel="stylesheet" type="text/css" href="/src/style/common.css" />
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
|
||||
<script src="/src/scripts/mobileScroll.js"></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div>
|
||||
<div id="menu">
|
||||
<div id="logo_wrapper" class="svg_wrapper">
|
||||
<a href="/index.html">
|
||||
<img id="logo_foh"src="/src/img/logo.svg" alt="환대의 조각 로고">
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<span id="to_about">
|
||||
<a href="/about.html">
|
||||
ABOUT
|
||||
</a>
|
||||
</span>
|
||||
<span id="to_fragments">
|
||||
<a href="/participants.html">
|
||||
FRAGMENTS
|
||||
</a>
|
||||
</span>
|
||||
<span id="to_timeline">
|
||||
<a href="#">
|
||||
TIMELINE
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div id="margin">
|
||||
<!-- to avoid overlapping -->
|
||||
</div>
|
||||
|
||||
<div id="wrapper_author">
|
||||
<div id="fragment_wrapper">
|
||||
</div>
|
||||
<div id="introduction">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="archive_exit" style="display:none;"></div>
|
||||
<div id="archive">
|
||||
<button id="archive_button">ARCHIVE
|
||||
<!-- <img id="icon_archive_more" src="src/img/icon_timeline.svg" alt=""> -->
|
||||
</button>
|
||||
<div id="archive_list">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="contents">
|
||||
<div id="frags">
|
||||
<div class="json"><a class="anchor" id="-1"></a><a href='event_0000.meta'>event_0000.meta</a><span class="filename">event_0000.meta</span><span class="fid">#-1</span></div>
|
||||
<div class="json"><a class="anchor" id="-1"></a><a href='event_0001.meta'>event_0001.meta</a><span class="filename">event_0001.meta</span><span class="fid">#-1</span></div>
|
||||
<a href="../">../</a>
|
||||
<div class="folder"><a class="anchor" id="0000"></a>
|
||||
<div class="jpeg"><figure><img class="image" src="./event_0000/124157237_121248643124584_872058020963845448_n.jpg"><figcaption>124157237_121248643124584_872058020963845448_n.jpg</figcaption></figure></div>
|
||||
<div class="jpeg"><figure><img class="image" src="./event_0000/124469821_121248626457919_479957910997498417_n.jpg"><figcaption>124469821_121248626457919_479957910997498417_n.jpg</figcaption></figure></div>
|
||||
<div class="jpeg"><figure><img class="image" src="./event_0000/124476076_121248659791249_2342598949363915450_n.jpg"><figcaption>124476076_121248659791249_2342598949363915450_n.jpg</figcaption></figure></div>
|
||||
<span class="fid">#0000</span></div>
|
||||
<div class="folder"><a class="anchor" id="0001"></a>
|
||||
<div class="plain"><div>이벤트 0001 에 대한 설명문
|
||||
이벤트 0001 에 대한 설명문
|
||||
이벤트 0001 에 대한 설명문
|
||||
이벤트 0001 에 대한 설명문
|
||||
이벤트 0001 에 대한 설명문
|
||||
이벤트 0001 에 대한 설명문
|
||||
이벤트 0001 에 대한 설명문
|
||||
이벤트 0001 에 대한 설명문
|
||||
이벤트 0001 에 대한 설명문
|
||||
이벤트 0001 에 대한 설명문
|
||||
이벤트 0001 에 대한 설명문
|
||||
이벤트 0001 에 대한 설명문
|
||||
이벤트 0001 에 대한 설명문
|
||||
이벤트 0001 에 대한 설명문
|
||||
이벤트 0001 에 대한 설명문
|
||||
이벤트 0001 에 대한 설명문
|
||||
이벤트 0001 에 대한 설명문
|
||||
이벤트 0001 에 대한 설명문
|
||||
이벤트 0001 에 대한 설명문
|
||||
이벤트 0001 에 대한 설명문
|
||||
이벤트 0001 에 대한 설명문
|
||||
이벤트 0001 에 대한 설명문
|
||||
이벤트 0001 에 대한 설명문
|
||||
이벤트 0001 에 대한 설명문
|
||||
|
||||
|
||||
</div><span class="filename">event_0001.txt</span></div>
|
||||
<span class="fid">#0001</span></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="/src/scripts/updateIntroduction.js"></script>
|
||||
<script src="/src/scripts/updateArchive.js"></script>
|
||||
<script src="/src/scripts/hashEvent.js"></script>
|
||||
<script src="/src/scripts/mobileArchiveEvent.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"occupation": 8
|
||||
}
|
||||
|
|
@ -1,75 +0,0 @@
|
|||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<!-- Generated with distribusi https://git.vvvvvvaria.org/varia/distribusi -->
|
||||
<meta name="generator" content="distribusi" />
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="./style.css" />
|
||||
<link rel="stylesheet" type="text/css" href="/src/style/common.css" />
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
|
||||
<script src="/src/scripts/mobileScroll.js"></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div>
|
||||
<div id="menu">
|
||||
<div id="logo_wrapper" class="svg_wrapper">
|
||||
<a href="/index.html">
|
||||
<img id="logo_foh"src="/src/img/logo.svg" alt="환대의 조각 로고">
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<span id="to_about">
|
||||
<a href="/about.html">
|
||||
ABOUT
|
||||
</a>
|
||||
</span>
|
||||
<span id="to_fragments">
|
||||
<a href="/participants.html">
|
||||
FRAGMENTS
|
||||
</a>
|
||||
</span>
|
||||
<span id="to_timeline">
|
||||
<a href="#">
|
||||
TIMELINE
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div id="margin">
|
||||
<!-- to avoid overlapping -->
|
||||
</div>
|
||||
|
||||
<div id="wrapper_author">
|
||||
<div id="fragment_wrapper">
|
||||
</div>
|
||||
<div id="introduction">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="archive_exit" style="display:none;"></div>
|
||||
<div id="archive">
|
||||
<button id="archive_button">ARCHIVE
|
||||
<!-- <img id="icon_archive_more" src="src/img/icon_timeline.svg" alt=""> -->
|
||||
</button>
|
||||
<div id="archive_list">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="contents">
|
||||
<div id="frags">
|
||||
<div class="json"><a class="anchor" id="-1"></a><a href='event_0008.meta'>event_0008.meta</a><span class="filename">event_0008.meta</span><span class="fid">#-1</span></div>
|
||||
<a href="../">../</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="/src/scripts/updateIntroduction.js"></script>
|
||||
<script src="/src/scripts/updateArchive.js"></script>
|
||||
<script src="/src/scripts/hashEvent.js"></script>
|
||||
<script src="/src/scripts/mobileArchiveEvent.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Reference in a new issue