add template staticfiles
This commit is contained in:
parent
73c8a9e158
commit
f7015d2594
6 changed files with 7 additions and 4 deletions
11
index.py
11
index.py
|
@ -3,11 +3,13 @@ import json
|
|||
|
||||
from datetime import datetime
|
||||
from string import Template
|
||||
from distutils.dir_util import copy_tree
|
||||
|
||||
from config import (
|
||||
INDEX_TEMPLATE,
|
||||
INDEX_ROW_TEMPLATE,
|
||||
LINK_INDEX_TEMPLATE,
|
||||
TEMPLATE_STATICFILES,
|
||||
ARCHIVE_PERMISSIONS,
|
||||
ARCHIVE_DIR,
|
||||
ANSI,
|
||||
|
@ -31,11 +33,10 @@ def write_links_index(out_dir, links):
|
|||
write_json_links_index(out_dir, links)
|
||||
write_html_links_index(out_dir, links)
|
||||
|
||||
print('[√] [{}] Archive index is now up-to-date with {}{}{} links.'.format(
|
||||
print('[√] [{}] Main archive index now up-to-date: {}/index.html'.format(
|
||||
datetime.now().strftime('%Y-%m-%d %H:%M:%S'),
|
||||
ANSI['green'],
|
||||
len(links),
|
||||
ANSI['reset'],
|
||||
out_dir,
|
||||
|
||||
))
|
||||
|
||||
def write_json_links_index(out_dir, links):
|
||||
|
@ -71,6 +72,8 @@ def write_html_links_index(out_dir, links):
|
|||
|
||||
path = os.path.join(out_dir, 'index.html')
|
||||
|
||||
copy_tree(TEMPLATE_STATICFILES, os.path.join(out_dir, "static"))
|
||||
|
||||
with open(INDEX_TEMPLATE, 'r', encoding='utf-8') as f:
|
||||
index_html = f.read()
|
||||
|
||||
|
|
BIN
templates/static/archive.png
Normal file
BIN
templates/static/archive.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
BIN
templates/static/complete.png
Normal file
BIN
templates/static/complete.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.5 KiB |
BIN
templates/static/external.png
Normal file
BIN
templates/static/external.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
BIN
templates/static/incomplete.png
Normal file
BIN
templates/static/incomplete.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.7 KiB |
BIN
templates/static/spinner.gif
Normal file
BIN
templates/static/spinner.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
Loading…
Add table
Reference in a new issue