Compare commits
10 commits
bbc83f2c88
...
ac350241ba
| Author | SHA1 | Date | |
|---|---|---|---|
| ac350241ba | |||
| 71b04eb48a | |||
| c0fa410d91 | |||
| dcd0ecbd6e | |||
| e53b410a6d | |||
| 3e4914d514 | |||
| 6d2a98e5ba | |||
| 17572f77a7 | |||
|
|
890c9be3ab | ||
|
|
e3e6a04ccf |
11 changed files with 85 additions and 42 deletions
|
|
@ -200,13 +200,13 @@ def render_dir(args, directory):
|
||||||
# example: MIME plain/text becomes 'type' plain 'subtype' text
|
# example: MIME plain/text becomes 'type' plain 'subtype' text
|
||||||
type_, subtype = mime.split('/')
|
type_, subtype = mime.split('/')
|
||||||
|
|
||||||
c = name
|
cap = untag(name)
|
||||||
|
|
||||||
if args.verbose:
|
if args.verbose:
|
||||||
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(quote(relative_path), c, c)
|
a = FILE_TYPES[type_].format(quote(relative_path), cap, cap)
|
||||||
|
|
||||||
# expansion for different kind of text files
|
# expansion for different kind of text files
|
||||||
if type_ == 'text':
|
if type_ == 'text':
|
||||||
|
|
@ -227,14 +227,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(quote(relative_path), c, c)
|
a = FILE_TYPES[type_].format(quote(relative_path), cap, cap)
|
||||||
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 = ""
|
cap = ""
|
||||||
if args.captions:
|
if args.captions:
|
||||||
c = caption(relative_path)
|
cap = untag(caption(relative_path))
|
||||||
a = FILE_TYPES[type_].format(quote(relative_path), c, c)
|
a = FILE_TYPES[type_].format(quote(relative_path), cap, cap)
|
||||||
# ALT 처리
|
# ALT 처리
|
||||||
src = os.path.splitext(full_path)
|
src = os.path.splitext(full_path)
|
||||||
alt_path = src[0] + ".alt"
|
alt_path = src[0] + ".alt"
|
||||||
|
|
@ -246,7 +246,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(quote(relative_path), alt, c)
|
a = FILE_TYPES[type_].format(quote(relative_path), alt, cap)
|
||||||
|
|
||||||
if subtype in SUB_TYPES:
|
if subtype in SUB_TYPES:
|
||||||
a = SUB_TYPES[subtype]
|
a = SUB_TYPES[subtype]
|
||||||
|
|
@ -315,14 +315,14 @@ def distribusify(args, directory, freg): # noqa
|
||||||
# example: MIME plain/text becomes 'type' plain 'subtype' text
|
# example: MIME plain/text becomes 'type' plain 'subtype' text
|
||||||
type_, subtype = mime.split('/')
|
type_, subtype = mime.split('/')
|
||||||
|
|
||||||
c = name
|
cap = untag(name)
|
||||||
|
|
||||||
if args.verbose:
|
if args.verbose:
|
||||||
print('Found', name, 'as', mime)
|
print('Found', name, 'as', mime)
|
||||||
|
|
||||||
if type_ in FILE_TYPES:
|
if type_ in FILE_TYPES:
|
||||||
|
|
||||||
a = FILE_TYPES[type_].format(quote(name), c, c)
|
a = FILE_TYPES[type_].format(quote(name), cap, cap)
|
||||||
|
|
||||||
# expansion for different kind of text files
|
# expansion for different kind of text files
|
||||||
if type_ == 'text':
|
if type_ == 'text':
|
||||||
|
|
@ -346,10 +346,10 @@ def distribusify(args, directory, freg): # noqa
|
||||||
if args.thumbnail:
|
if args.thumbnail:
|
||||||
a = thumbnail(full_path, name, args)
|
a = thumbnail(full_path, name, args)
|
||||||
if args.no_filenames:
|
if args.no_filenames:
|
||||||
c = ""
|
cap = ""
|
||||||
if args.captions:
|
if args.captions:
|
||||||
c = caption(full_path)
|
cap = untag(caption(full_path))
|
||||||
a = FILE_TYPES[type_].format(quote(name), c, c)
|
a = FILE_TYPES[type_].format(quote(name), cap, cap)
|
||||||
# ALT 처리
|
# ALT 처리
|
||||||
src = os.path.splitext(full_path)
|
src = os.path.splitext(full_path)
|
||||||
alt_path = src[0] + ".alt"
|
alt_path = src[0] + ".alt"
|
||||||
|
|
@ -362,7 +362,7 @@ def distribusify(args, directory, freg): # noqa
|
||||||
alt = alt + line + ' '
|
alt = alt + line + ' '
|
||||||
print("alt: " + alt )
|
print("alt: " + alt )
|
||||||
|
|
||||||
a = FILE_TYPES[type_].format(quote(name), alt, c)
|
a = FILE_TYPES[type_].format(quote(name), alt, cap)
|
||||||
|
|
||||||
if subtype in SUB_TYPES:
|
if subtype in SUB_TYPES:
|
||||||
a = SUB_TYPES[subtype]
|
a = SUB_TYPES[subtype]
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ PATTERN_TAG_FOLDER = re.compile(r"(?P<name>.+?)(?P<tags>\#.+)\/(?P<file>.+)")
|
||||||
def cleanfolder(folder):
|
def cleanfolder(folder):
|
||||||
for filename in os.listdir(folder):
|
for filename in os.listdir(folder):
|
||||||
file_path = os.path.join(folder, filename)
|
file_path = os.path.join(folder, filename)
|
||||||
|
print('deleting: ' + file_path)
|
||||||
try:
|
try:
|
||||||
if os.path.isfile(file_path) or os.path.islink(file_path):
|
if os.path.isfile(file_path) or os.path.islink(file_path):
|
||||||
os.unlink(file_path)
|
os.unlink(file_path)
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ html_head = """
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<a href="https://nothingmakesitself.art"><img src="https://freight.cargo.site/t/original/i/abcd0824382cdb1e6c2efca6e3d5ae4dd8fc33f6ed88bddbfa25923073865abf/12313123100.png" class="arko"></a>
|
<a href="https://nothingmakesitself.art/Satellite-Project"><img src="https://freight.cargo.site/t/original/i/abcd0824382cdb1e6c2efca6e3d5ae4dd8fc33f6ed88bddbfa25923073865abf/12313123100.png" class="arko"></a>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -83,6 +83,28 @@ html_footer = """
|
||||||
<script src="/src/scripts/hashEvent.js"></script>
|
<script src="/src/scripts/hashEvent.js"></script>
|
||||||
<script src="/src/scripts/mobileArchiveEvent.js"></script>
|
<script src="/src/scripts/mobileArchiveEvent.js"></script>
|
||||||
<script src="/src/scripts/accessibility.js"></script>
|
<script src="/src/scripts/accessibility.js"></script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.arko {
|
||||||
|
position: fixed;
|
||||||
|
right: 20px;
|
||||||
|
bottom: 55px;
|
||||||
|
width:150px;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@media ( min-width: 1080px ) {
|
||||||
|
.arko {
|
||||||
|
position: fixed;
|
||||||
|
right: 20px;
|
||||||
|
bottom: 20px;
|
||||||
|
width:150px;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
|
|
@ -2,14 +2,18 @@
|
||||||
# 2020. 10. 26
|
# 2020. 10. 26
|
||||||
from distribusi.cli import build_argparser, distribusify
|
from distribusi.cli import build_argparser, distribusify
|
||||||
from distribusi import fragments
|
from distribusi import fragments
|
||||||
|
from filelock import Timeout, FileLock
|
||||||
|
|
||||||
parser = build_argparser()
|
lock = FileLock("./data/.lock")
|
||||||
args = parser.parse_args()
|
|
||||||
|
|
||||||
data_path = args.directory
|
with lock:
|
||||||
|
parser = build_argparser()
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
freg = fragments.Fragments()
|
data_path = args.directory
|
||||||
freg.preindex(data_path)
|
|
||||||
freg.postindex()
|
|
||||||
|
|
||||||
distribusify(args, data_path, freg)
|
freg = fragments.Fragments()
|
||||||
|
freg.preindex(data_path)
|
||||||
|
freg.postindex()
|
||||||
|
|
||||||
|
distribusify(args, data_path, freg)
|
||||||
|
|
|
||||||
0
new
0
new
14
poetry.lock
generated
14
poetry.lock
generated
|
|
@ -1,3 +1,11 @@
|
||||||
|
[[package]]
|
||||||
|
name = "filelock"
|
||||||
|
version = "3.0.12"
|
||||||
|
description = "A platform independent file lock."
|
||||||
|
category = "main"
|
||||||
|
optional = false
|
||||||
|
python-versions = "*"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "markdown"
|
name = "markdown"
|
||||||
version = "3.3.4"
|
version = "3.3.4"
|
||||||
|
|
@ -28,9 +36,13 @@ python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*"
|
||||||
[metadata]
|
[metadata]
|
||||||
lock-version = "1.1"
|
lock-version = "1.1"
|
||||||
python-versions = "^3.8"
|
python-versions = "^3.8"
|
||||||
content-hash = "e17d31e9ee7949d99baf929cdd55b9565284dbe08e81d3cb7691f58cb5a04c74"
|
content-hash = "2122e4cf5f141d6098cc17000ce0ab06dc0caabd0f43e92c3dc7cd88f67b5934"
|
||||||
|
|
||||||
[metadata.files]
|
[metadata.files]
|
||||||
|
filelock = [
|
||||||
|
{file = "filelock-3.0.12-py3-none-any.whl", hash = "sha256:929b7d63ec5b7d6b71b0fa5ac14e030b3f70b75747cef1b10da9b879fef15836"},
|
||||||
|
{file = "filelock-3.0.12.tar.gz", hash = "sha256:18d82244ee114f543149c66a6e0c14e9c4f8a1044b5cdaadd0f82159d6a6ff59"},
|
||||||
|
]
|
||||||
markdown = [
|
markdown = [
|
||||||
{file = "Markdown-3.3.4-py3-none-any.whl", hash = "sha256:96c3ba1261de2f7547b46a00ea8463832c921d3f9d6aba3f255a6f71386db20c"},
|
{file = "Markdown-3.3.4-py3-none-any.whl", hash = "sha256:96c3ba1261de2f7547b46a00ea8463832c921d3f9d6aba3f255a6f71386db20c"},
|
||||||
{file = "Markdown-3.3.4.tar.gz", hash = "sha256:31b5b491868dcc87d6c24b7e3d19a0d730d59d3e46f4eea6430a321bed387a49"},
|
{file = "Markdown-3.3.4.tar.gz", hash = "sha256:31b5b491868dcc87d6c24b7e3d19a0d730d59d3e46f4eea6430a321bed387a49"},
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ python = "^3.8"
|
||||||
Pillow = "^8.3.1"
|
Pillow = "^8.3.1"
|
||||||
python-magic = "^0.4.24"
|
python-magic = "^0.4.24"
|
||||||
Markdown = "^3.3.4"
|
Markdown = "^3.3.4"
|
||||||
|
filelock = "^3.0.12"
|
||||||
|
|
||||||
[tool.poetry.dev-dependencies]
|
[tool.poetry.dev-dependencies]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<a href="https://nothingmakesitself.art"><img src="https://freight.cargo.site/t/original/i/abcd0824382cdb1e6c2efca6e3d5ae4dd8fc33f6ed88bddbfa25923073865abf/12313123100.png" class="arko"></a>
|
<a href="https://nothingmakesitself.art/Satellite-Project"><img src="https://freight.cargo.site/t/original/i/abcd0824382cdb1e6c2efca6e3d5ae4dd8fc33f6ed88bddbfa25923073865abf/12313123100.png" class="arko"></a>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<a href="https://nothingmakesitself.art"><img src="https://freight.cargo.site/t/original/i/abcd0824382cdb1e6c2efca6e3d5ae4dd8fc33f6ed88bddbfa25923073865abf/12313123100.png" class="arko"></a>
|
<a href="https://nothingmakesitself.art/Satellite-Project"><img src="https://freight.cargo.site/t/original/i/abcd0824382cdb1e6c2efca6e3d5ae4dd8fc33f6ed88bddbfa25923073865abf/12313123100.png" class="arko"></a>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<a href="https://nothingmakesitself.art"><img src="https://freight.cargo.site/t/original/i/abcd0824382cdb1e6c2efca6e3d5ae4dd8fc33f6ed88bddbfa25923073865abf/12313123100.png" class="arko"></a>
|
<a href="https://nothingmakesitself.art/Satellite-Project"><img src="https://freight.cargo.site/t/original/i/abcd0824382cdb1e6c2efca6e3d5ae4dd8fc33f6ed88bddbfa25923073865abf/12313123100.png" class="arko"></a>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -438,6 +438,7 @@
|
||||||
padding-top: 50px;
|
padding-top: 50px;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
|
line-height: 1.55rem;
|
||||||
/* padding:20px; */
|
/* padding:20px; */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -484,6 +485,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
#hideMe{
|
#hideMe{
|
||||||
|
top:0px;
|
||||||
|
left:0px;
|
||||||
background: url(https://freight.cargo.site/t/original/i/5d73492aa3e9257fd9fab2d4677af532db8a388f792c55f99cf9168cb2024bb2/arkowebtest3.png) no-repeat center center fixed;
|
background: url(https://freight.cargo.site/t/original/i/5d73492aa3e9257fd9fab2d4677af532db8a388f792c55f99cf9168cb2024bb2/arkowebtest3.png) no-repeat center center fixed;
|
||||||
-webkit-background-size: cover;
|
-webkit-background-size: cover;
|
||||||
-moz-background-size: cover;
|
-moz-background-size: cover;
|
||||||
|
|
@ -492,8 +495,8 @@
|
||||||
margin:0;
|
margin:0;
|
||||||
text-align:center;
|
text-align:center;
|
||||||
position:fixed;
|
position:fixed;
|
||||||
width:100%;
|
width:100vw;
|
||||||
height:100%;
|
height:100vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
.arko {
|
.arko {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue