# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
import codecs
import csv
# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
import codecs
import csv
from django.core.mail import send_mail
from django.http import HttpResponse
from django.template.loader import render_to_string
from django.core.mail import send_mail
from django.http import HttpResponse
from django.template.loader import render_to_string
def stringify_keys(dictionary):
return dict((keyword.encode('ascii'), value)
def stringify_keys(dictionary):
return dict((keyword.encode('ascii'), value)
def __init__(self, f, dialect=csv.excel, encoding="utf-8", **kwds):
# Redirect output to a queue
def __init__(self, f, dialect=csv.excel, encoding="utf-8", **kwds):
# Redirect output to a queue
self.writer = csv.writer(self.queue, dialect=dialect, **kwds)
self.stream = f
self.encoder = codecs.getincrementalencoder(encoding)()
self.writer = csv.writer(self.queue, dialect=dialect, **kwds)
self.stream = f
self.encoder = codecs.getincrementalencoder(encoding)()