From 81ab050cd23c90a319e650b3c2e322e5b42ee574 Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Mon, 30 Oct 2017 03:36:42 -0500 Subject: [PATCH] switch back to relative paths --- archive_methods.py | 35 +++++++++++++++++------------------ config.py | 2 +- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/archive_methods.py b/archive_methods.py index 7d30f8d8..3af8b226 100644 --- a/archive_methods.py +++ b/archive_methods.py @@ -92,6 +92,23 @@ def archive_link(out_dir, link, overwrite=False): return link +def log_link_archive(out_dir, link): + update_existing = os.path.exists(out_dir) + if not update_existing: + os.makedirs(out_dir) + + print('[{symbol_color}{symbol}{reset}] [{timestamp}] "{title}": {blue}{base_url}{reset}'.format( + symbol='*' if update_existing else '+', + symbol_color=ANSI['black' if update_existing else 'green'], + **link, + **ANSI, + )) + if link['type']: + print(' i Type: {}'.format(link['type'])) + + print(' {} ({})'.format(out_dir, 'updating' if update_existing else 'creating')) + + def attach_result_to_link(method): """ @@ -397,21 +414,3 @@ def fetch_favicon(out_dir, link, timeout=TIMEOUT): # raise # else: # print(' √ Skipping video download') - - - -def log_link_archive(out_dir, link): - update_existing = os.path.exists(out_dir) - if not update_existing: - os.makedirs(out_dir) - - print('[{symbol_color}{symbol}{reset}] [{timestamp}] "{title}": {blue}{base_url}{reset}'.format( - symbol='*' if update_existing else '+', - symbol_color=ANSI['black' if update_existing else 'green'], - **link, - **ANSI, - )) - if link['type']: - print(' i Type: {}'.format(link['type'])) - - print(' {} ({})'.format(out_dir, 'exists' if update_existing else 'created')) diff --git a/config.py b/config.py index 0f37920f..5b65506f 100644 --- a/config.py +++ b/config.py @@ -34,7 +34,7 @@ INDEX_ROW_TEMPLATE = os.getenv('INDEX_ROW_TEMPLATE', 'templates/index_ro ### Output Paths ROOT_FOLDER = os.path.dirname(os.path.abspath(__file__)) -HTML_FOLDER = os.path.join(ROOT_FOLDER, ARCHIVE_DIR, 'html') +HTML_FOLDER = os.path.join(ARCHIVE_DIR, 'html') ARCHIVE_FOLDER = os.path.join(HTML_FOLDER, 'archive') os.chdir(ROOT_FOLDER)