+# -*- 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.
+#
"""
Provides a way to create forms behaving correctly as AJAX forms
as well as standalone forms without any Javascript.
+# -*- 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.
+#
from django import template
from ajaxable.utils import placeholdized
register = template.Library()
+# -*- 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.
+#
from functools import wraps
from django.http import (HttpResponse, HttpResponseRedirect,
# -*- 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.
-
+#
from datetime import datetime, timedelta
import json
from urlparse import urljoin
from django.contrib.sites.models import Site
from django.core.cache import get_cache
from django.core.urlresolvers import reverse
+from django.utils.timezone import utc
from piston.handler import AnonymousBaseHandler, BaseHandler
from piston.utils import rc
from sorl.thumbnail import default
from catalogue.utils import related_tag_name
from picture.models import Picture
from picture.forms import PictureImportForm
+from wolnelektury.utils import tz
from stats.utils import piwik_track
"""
# set to five minutes ago, to avoid concurrency issues
if t is None:
- t = datetime.now() - timedelta(seconds=settings.API_WAIT)
+ t = datetime.utcnow().replace(tzinfo=utc) - timedelta(seconds=settings.API_WAIT)
# set to whole second in case DB supports something smaller
return t.replace(microsecond=0)
@classmethod
def book_changes(cls, request=None, since=0, until=None, fields=None):
- since = datetime.fromtimestamp(int(since))
+ since = datetime.fromtimestamp(int(since), tz)
until = cls.until(until)
changes = {
@classmethod
def tag_changes(cls, request=None, since=0, until=None, fields=None, categories=None):
- since = datetime.fromtimestamp(int(since))
+ since = datetime.fromtimestamp(int(since), tz)
until = cls.until(until)
changes = {
# -*- 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.
+#
from time import mktime
from piston.resource import Resource
+# -*- 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 os.path
from django.conf import settings
# -*- 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.
+#
from os import path
from django.core.files.uploadedfile import SimpleUploadedFile
# -*- coding: utf-8 -*-
-from django.conf.urls.defaults import *
+# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
+# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
+#
+from django.conf.urls import patterns, url
from django.views.decorators.csrf import csrf_exempt
from django.views.generic import TemplateView
from piston.authentication import OAuthAuthentication, oauth_access_token
+# -*- 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.
+#
from catalogue.tests.book_import import *
from catalogue.tests.bookmedia import *
from catalogue.tests.cover import *
# -*- 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.
+#
from django.conf import settings
from django.core.files.base import ContentFile, File
# -*- 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.
+#
from django.conf import settings
from os.path import basename, exists, join, dirname
from django.core.files.base import ContentFile, File
# -*- 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.
+#
from django.core.files.base import ContentFile
from catalogue.test_utils import BookInfoStub, PersonStub, info_args, WLTestCase
from catalogue.models import Book
# -*- 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.
+#
from catalogue import models, views
from catalogue.test_utils import *
# -*- 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.
+#
from django.core.files.base import ContentFile
from django.test import Client
from catalogue import models
# -*- 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.
+#
from catalogue import models
from catalogue.templatetags import catalogue_tags
from catalogue.test_utils import *
# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
-from django.conf.urls.defaults import *
+from django.conf.urls import patterns, url
from django.db.models import Max
from django.views.generic import ListView, RedirectView
from catalogue.feeds import AudiobookFeed
# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
-from django.conf.urls.defaults import *
+from django.conf.urls import patterns, url
from dictionary.views import NotesView
urlpatterns = patterns('dictionary.views',
from django.conf import settings
from django.template.loader import render_to_string
from django.db import models
+from django.utils.timezone import utc
from django.utils.translation import ugettext_lazy as _, ugettext, override
import getpaid
from catalogue.models import Book
'remaining': self.remaining(),
'current': self.current(),
})
- self.notified_end = datetime.now()
+ self.notified_end = datetime.utcnow().replace(tzinfo=utc)
self.save()
def notify_near(self, force=False):
'sum': sum_,
'need': need,
})
- self.notified_near = datetime.now()
+ self.notified_near = datetime.utcnow().replace(tzinfo=utc)
self.save()
def notify_published(self):
with override(self.language_code or app_settings.DEFAULT_LANGUAGE):
send_mail(subject,
render_to_string(template_name, context),
- getattr(settings, 'CONTACT_EMAIL', 'wolnelektury@nowoczesnapolska.org.pl'),
+ settings.CONTACT_EMAIL,
[self.email],
fail_silently=False
)
def payment_status_changed_listener(sender, instance, old_status, new_status, **kwargs):
""" React to status changes from getpaid. """
if old_status != 'paid' and new_status == 'paid':
- instance.order.payed_at = datetime.now()
+ instance.order.payed_at = datetime.utcnow().replace(tzinfo=utc)
instance.order.save()
if instance.order.email:
instance.order.notify(
+# -*- 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.
+#
from django import template
from ..models import Offer
from ..utils import sanitize_payment_title
-# -*- coding: utf-8
+# -*- 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 re
import string
from fnpdjango.utils.text.slughifi import char_map
+# -*- 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.
+#
from django.contrib import admin
from modeltranslation.admin import TranslationAdmin
class InfoPageAdmin(TranslationAdmin):
list_display = ('title', 'slug', 'main_page')
-admin.site.register(InfoPage, InfoPageAdmin)
\ No newline at end of file
+admin.site.register(InfoPage, InfoPageAdmin)
# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
-from django.conf.urls.defaults import *
+from django.conf.urls import patterns, url
urlpatterns = patterns('infopages.views',
# -*- 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.
+#
+
# Leśmianator do działania wymaga pliku dictionary.p w katalogu aplikacji
# plik ten powinien zawierać słownik postaci:
# <3-znakowy ciąg> => <kolejny znak> => <częstość występowania>
from django.core.files.base import ContentFile
from django.db import models
from django.db.models import permalink
+from django.utils.timezone import utc
from django.utils.translation import ugettext_lazy as _
from django.core.urlresolvers import reverse
from django.db.models.signals import m2m_changed
def visit(self):
self.view_count += 1
- self.seen_at = datetime.now()
+ self.seen_at = datetime.utcnow().replace(tzinfo=utc)
self.save()
def __unicode__(self):
# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
-from django.conf.urls.defaults import *
-from catalogue.models import Book
+from django.conf.urls import url, patterns
urlpatterns = patterns('lesmianator.views',
url(r'^$', 'main_page', name='lesmianator'),
-# Create your views here.
-
+# -*- 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.
+#
from django.http import Http404
from django.shortcuts import render_to_response, get_object_or_404
from django.template import RequestContext
+# -*- coding: utf-8 -*-\r
+# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.\r
+# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.\r
+#\r
from django.contrib import admin\r
\r
from libraries.models import Library, Catalog\r
+# -*- coding: utf-8 -*-\r
+# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.\r
+# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.\r
+#\r
from django.db import models\r
from django.utils.translation import ugettext_lazy as _\r
\r
\r
@models.permalink\r
def get_absolute_url(self):\r
- return ('libraries_library_view', [self.catalog.slug, self.slug])
\ No newline at end of file
+ return ('libraries_library_view', [self.catalog.slug, self.slug])\r
-from django.conf.urls.defaults import patterns, url
+# -*- 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.
+#
+from django.conf.urls import patterns, url
from django.http import HttpResponseRedirect
url(r'^/$', lambda x: HttpResponseRedirect(x.path[:-1])),
url(r'^/(?P<slug>[a-zA-Z0-9_-]+)$', 'catalog_view', name='libraries_catalog_view'),
url(r'^/(?P<catalog_slug>[a-zA-Z0-9_-]+)/(?P<slug>[a-zA-Z0-9_-]+)$', 'library_view', name='libraries_library_view'),
-)
\ No newline at end of file
+)
+# -*- coding: utf-8 -*-\r
+# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.\r
+# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.\r
+#\r
from django.shortcuts import render_to_response, get_object_or_404\r
from django.template import RequestContext, Template, TemplateSyntaxError\r
\r
def library_view(request, catalog_slug, slug):\r
context = RequestContext(request)\r
context['library'] = get_object_or_404(Library.objects.filter(slug = slug).filter(catalog__slug = catalog_slug))\r
- return render_to_response('libraries/library_view.html', context_instance = context)
\ No newline at end of file
+ return render_to_response('libraries/library_view.html', context_instance = context)\r
# -*- coding: utf-8 -*-
-from django.conf.urls.defaults import *
+from django.conf.urls import patterns, url
urlpatterns = patterns('',
url(r'^set_language/$', 'django.views.i18n.set_language', {},
+# -*- 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.
+#
from oaipmh import server, common, metadata, error
from catalogue.models import Book, Tag
from api.models import Deleted
+# -*- 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.
+#
from oai.tests.oaipmhapi import *
-
-
+# -*- 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.
+#
from catalogue.test_utils import WLTestCase
from catalogue import models
from nose.tools import raises
-
-from django.conf.urls.defaults import *
+# -*- 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.
+#
+from django.conf.urls import patterns, url
urlpatterns = patterns('oai.views',
url(r'^$', 'oaipmh', name='oaipmh'))
-
+# -*- 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.
+#
from oai.handlers import Catalogue, NS_DCTERMS, nsdcterms
from oaipmh.server import ServerBase, oai_dc_writer, NS_OAIDC, NS_DC, NS_XSI, nsoaidc, nsdc
from oaipmh.metadata import MetadataRegistry
# -*- 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.
+#
from lxml import etree
from django.core.files.base import ContentFile
import catalogue
# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
-from django.conf.urls.defaults import *
+from django.conf.urls import patterns, url
from opds.views import RootFeed, ByCategoryFeed, ByTagFeed, UserFeed, UserSetFeed, SearchFeed
+# -*- 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 datetime
import pytz
from django.conf import settings
-
+# -*- 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.
+#
from django.contrib import admin
from picture.models import Picture
from sorl.thumbnail.admin import AdminImageMixin
+# -*- 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.
+#
from django import forms
from django.utils.translation import ugettext_lazy as _
from picture.models import Picture
+# -*- 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.
+#
from django.db import models, transaction
import catalogue.models
from django.db.models import permalink
+# -*- 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.
+#
from django import template
from django.template import Node, Variable, Template, Context
from catalogue.utils import split_tags
+# -*- 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.
+#
from picture.tests.picture_import import *
# -*- 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.
+#
from __future__ import with_statement
from os import path
-
+# -*- 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.
+#
from django.contrib.auth.decorators import permission_required
from django.utils.datastructures import SortedDict
from django.shortcuts import render_to_response, get_object_or_404
+# -*- 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.
+#
from django.contrib import admin
from models import Poll, PollItem
admin.site.register(Poll, PollAdmin)
-admin.site.register(PollItem, PollItemAdmin)
\ No newline at end of file
+admin.site.register(PollItem, PollItemAdmin)
+# -*- coding: utf-8 -*-\r
+# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.\r
+# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.\r
+#\r
from django import forms\r
\r
\r
def __init__(self, *args, **kwargs):
poll = kwargs.pop('poll', None)\r
super(PollForm, self).__init__(*args, **kwargs)\r
- self.fields['vote'].choices = [(item.id, item.content) for item in poll.items.all()]
\ No newline at end of file
+ self.fields['vote'].choices = [(item.id, item.content) for item in poll.items.all()]\r
+# -*- 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.
+#
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.core.exceptions import ValidationError
self.vote_count = self.vote_count + 1
self.save()
session.setdefault(USED_POLLS_KEY, set()).add(self.poll.id)
- session.save()
\ No newline at end of file
+ session.save()
+# -*- 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.
+#
from django import template
from ..forms import PollForm
voted_already = voted_already,
vote_count = poll.vote_count,
show_results = show_results
- )
\ No newline at end of file
+ )
-from django.conf.urls import patterns, url, include
+# -*- 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.
+#
+from django.conf.urls import patterns, url
urlpatterns = patterns('polls.views',
+# -*- 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.
+#
from django.views.decorators.http import require_http_methods\r
from django.shortcuts import get_object_or_404, redirect, render_to_response\r
from django.core.urlresolvers import reverse\r
return render_to_response('polls/poll.html', context)
\r
-
\ No newline at end of file
+
# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
-from django.conf.urls.defaults import *
+from django.conf.urls import patterns, url
urlpatterns = patterns('reporting.views',
-
+# -*- 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.
+#
from index import Index, Search, SearchResult
-
+# -*- 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.
+#
from django.core.urlresolvers import reverse
from search.forms import SearchForm
-
+# -*- 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.
+#
from sunburnt import sunburnt
from lxml import etree
import urllib
# -*- 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.
+#
from django.conf import settings
import os
+# -*- 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
from django.core.management.base import BaseCommand
+# -*- 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.
+#
from django.core.management.base import BaseCommand
from glob import glob
+# -*- 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.
+#
from search.tests.index import *
# -*- 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.
+#
from django.conf import settings
from django.test.utils import override_settings
from catalogue.test_utils import WLTestCase, get_fixture
# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
-from django.conf.urls.defaults import *
+from django.conf.urls import patterns, url
urlpatterns = patterns('search.views',
url(r'^$', 'main', name='search'),
# -*- 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.
+#
from django.conf import settings
from django.shortcuts import render_to_response, get_object_or_404
from django.template import RequestContext
# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
-from django.conf.urls.defaults import *
+from django.conf.urls import patterns, url
from social.views import ObjectSetsFormView
urlpatterns = patterns('social.views',
+# -*- 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.
+#
from django.db.models import Q
from catalogue.models import Book, Tag
from catalogue import utils
# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
-from django.conf.urls.defaults import *
+from django.conf.urls import patterns, url
from suggest import views
urlpatterns = patterns('',
+# -*- 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.
+#
"""
Celery waiter.
Serves the file when ready. Kindly asks the user to wait if not.
Author: Radek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
-"""
\ No newline at end of file
+"""
+# -*- 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.
+#
from os.path import join, isfile
from django.core.urlresolvers import reverse
from django.db import models
+# -*- 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.
+#
from os.path import abspath, join
from django.conf import settings
+# -*- 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.
+#
from celery.signals import task_postrun
from waiter.models import WaitedFile
-from django.conf.urls.defaults import *
+# -*- 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.
+#
+from django.conf.urls import patterns, url
urlpatterns = patterns('waiter.views',
url(r'^(?P<path>.*)$', 'wait', name='waiter'),
+# -*- 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.
+#
from os.path import abspath, join, exists
from shutil import rmtree
from waiter.settings import WAITER_ROOT
+# -*- 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.
+#
from os.path import join
from waiter.models import WaitedFile
from waiter.settings import WAITER_URL
+# -*- 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.
+#
from django.conf import settings
def extra_settings(request):
-
+# -*- 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.
+#
from optparse import make_option
from django.conf import settings
from django.core.management.base import BaseCommand
+# -*- 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.
+#
from django import template
register = template.Library()
+# -*- 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.
+#
from datetime import datetime
import feedparser
# -*- 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 os
from django.conf.urls.defaults import *
+# -*- 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 pytz
from django.utils import timezone
from django.conf import settings
+tz = pytz.timezone(settings.TIME_ZONE)
+
def localtime_to_utc(localtime):
return timezone.utc.normalize(
- pytz.timezone(settings.TIME_ZONE).localize(localtime)
+ tz.localize(localtime)
)
def utc_for_js(dt):