From 9ea61bf3649c6af7cc90913f6fd32c9e7d3a4d03 Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Tue, 17 Apr 2018 06:57:41 -0400 Subject: [PATCH] fix archive path appending bug --- archive_methods.py | 6 ++++-- config.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/archive_methods.py b/archive_methods.py index 22d96cdb..003df75f 100644 --- a/archive_methods.py +++ b/archive_methods.py @@ -1,4 +1,5 @@ import os +import sys from functools import wraps from datetime import datetime @@ -46,7 +47,7 @@ def archive_links(archive_path, links, source=None, resume=None): idx, link = 0, to_archive.peek(0) try: for idx, link in enumerate(to_archive): - link_dir = os.path.join(archive_path, link['timestamp']) + link_dir = os.path.join(archive_path, 'archive', link['timestamp']) archive_link(link_dir, link) except (KeyboardInterrupt, SystemExit, Exception) as e: @@ -58,7 +59,8 @@ def archive_links(archive_path, links, source=None, resume=None): total=len(list(to_archive)), )) print(' Continue where you left off by running:') - print(' ./archive.py {} {}'.format( + print(' {} {} {}'.format( + sys.argv[0], source, link['timestamp'], )) diff --git a/config.py b/config.py index 5d32142c..1d926090 100644 --- a/config.py +++ b/config.py @@ -33,11 +33,11 @@ TIMEOUT = int(os.getenv('TIMEOUT', '60')) LINK_INDEX_TEMPLATE = os.getenv('LINK_INDEX_TEMPLATE', 'templates/link_index_fancy.html') INDEX_TEMPLATE = os.getenv('INDEX_TEMPLATE', 'templates/index.html') INDEX_ROW_TEMPLATE = os.getenv('INDEX_ROW_TEMPLATE', 'templates/index_row.html') +TEMPLATE_STATICFILES = os.getenv('TEMPLATE_STATICFILES', 'templates/static') ### Output Paths ROOT_FOLDER = os.path.dirname(os.path.abspath(__file__)) HTML_FOLDER = os.path.join(ARCHIVE_DIR, 'html') -ARCHIVE_FOLDER = os.path.join(HTML_FOLDER, 'archive') os.chdir(ROOT_FOLDER) # ******************************************************************************