X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/1e5176481313c3129d2f353993dbb721b21ef232..dff86ce568077249fc7c713bd35ce19a0bdb942e:/scripts/import_links.py?ds=sidebyside diff --git a/scripts/import_links.py b/scripts/import_links.py index ea4380fb8..0bc190e77 100644 --- a/scripts/import_links.py +++ b/scripts/import_links.py @@ -1,3 +1,8 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# import sys sys.path.insert(0, '../apps') sys.path.insert(0, '../lib') @@ -13,7 +18,7 @@ setup_environ(settings) from catalogue.models import Book, Tag -def import_tags(file_name, attribute): +def import_links(file_name, attribute): for line in file(file_name): slug, link = line.split() link = link.strip('\n') @@ -32,5 +37,5 @@ def import_tags(file_name, attribute): print 'Invalid slug %s!' % slug -import_tags('gazeta-links', 'gazeta_link') - +import_links('gazeta-links', 'gazeta_link') +import_links('wiki-links', 'wiki_link')