<commit_before># -*- coding: utf-8 -*-

from django.conf.urls import patterns, url
from django.views.generic import TemplateView
from django.views.decorators.cache import never_cache
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.decorators import login_required
from django.contrib.admin.views.decorators import staff_member_required

from .models.nonrel import Read

from .views import (home, read_with_endless_pagination,
                    help, toggle, read_one,
                    register, profile,
                    set_preference,
                    feed_closed_toggle,
                    google_reader_import,
                    google_reader_import_stop,
                    google_reader_import_status,
                    google_reader_can_import_toggle)


readpatterns = tuple(
    url(attrval.get('list_url'),
        login_required(never_cache(
            read_with_endless_pagination)),
        name=u'read_' + attrval.get('view_name'),
        kwargs={attrkey: True})
    for attrkey, attrval
        in Read.status_data.items()
        if 'list_url' in attrval
)

urlpatterns = patterns(
    'oneflow.core.views',
    url(_(r'^home/$'), login_required(never_cache(home)), name='home'),

    url(_(r'^preference/(?P<base>\w+)[\./](?P<sub>\w+)/(?P<value>\w+)/?$'),
        login_required(never_cache(set_preference)), name='set_preference'),

    url(_(r'^profile/$'), login_required(never_cache(profile)), name='profile'),


    # This one is not activated to the public yet.
    url(_(r'^read/all/$'), staff_member_required(never_cache(
        read_with_endless_pagination)), name='read_all',
        kwargs={'all': True}),

    url(_(r'^read/$'), login_required(never_cache(
        read_with_endless_pagination)), name='read'),

    url(_(r'^read/([0-9a-f]{24,24})/$'),
        login_required(read_one),
        name='read_one'),

    url(_(r'^(?P<klass>\w+)/(?P<oid>\w+)/toggle/(?P<key>\w+.\w+)/?$'),
        login_required(never_cache(toggle)), name='toggle'),

    url(_(r'^help/$'), login_required(help), name='help'),

    url(_(r'^register/$'), register, name='register'),
    url(_(r'^signin_error/$'), TemplateView.as_view(
        template_name='signin_error.html'), name='signin_error'),

    # •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••  Google Reader

    url(_(r'^grimport/(?:(?P<user_id>\d+)/)?$'),
        login_required(google_reader_import),<commit_msg>Exclude bookmarked reads from unread list.<commit_after># -*- coding: utf-8 -*-

from django.conf.urls import patterns, url
from django.views.generic import TemplateView
from django.views.decorators.cache import never_cache
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.decorators import login_required
from django.contrib.admin.views.decorators import staff_member_required

from .models.nonrel import Read

from .views import (home, read_with_endless_pagination,
                    help, toggle, read_one,
                    register, profile,
                    set_preference,
                    feed_closed_toggle,
                    google_reader_import,
                    google_reader_import_stop,
                    google_reader_import_status,
                    google_reader_can_import_toggle)


readpatterns = tuple(
    url(attrval.get('list_url'),
        login_required(never_cache(
            read_with_endless_pagination)),
        name=u'read_' + attrval.get('view_name'),
        kwargs={attrkey: True})
    for attrkey, attrval
        in Read.status_data.items()
        if 'list_url' in attrval
)

urlpatterns = patterns(
    'oneflow.core.views',
    url(_(r'^home/$'), login_required(never_cache(home)), name='home'),

    url(_(r'^preference/(?P<base>\w+)[\./](?P<sub>\w+)/(?P<value>\w+)/?$'),
        login_required(never_cache(set_preference)), name='set_preference'),

    url(_(r'^profile/$'), login_required(never_cache(profile)), name='profile'),


    # This one is not activated to the public yet.
    url(_(r'^read/all/$'), staff_member_required(never_cache(
        read_with_endless_pagination)), name='read_all',
        kwargs={'all': True}),

    url(_(r'^read/$'), login_required(never_cache(
        read_with_endless_pagination)), name='read',
        kwargs={'is_read': False, 'is_bookmarked': False}),

    url(_(r'^read/([0-9a-f]{24,24})/$'),
        login_required(read_one),
        name='read_one'),

    url(_(r'^(?P<klass>\w+)/(?P<oid>\w+)/toggle/(?P<key>\w+.\w+)/?$'),
        login_required(never_cache(toggle)), name='toggle'),

    url(_(r'^help/$'), login_required(help), name='help'),

    url(_(r'^register/$'), register, name='register'),
    url(_(r'^signin_error/$'), TemplateView.as_view(
        template_name='signin_error.html'), name='signin_error'),

    # •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••  Google Reader

    url(_(r'^grimport/(?:(?P<user_id>\d+)/)?$'),
        login_required(google_reader_import),
{'fraction_non_alphanumeric': 0.17755511022044088, 'fraction_numerical': 0.0028056112224448897, 'mean_word_length': 3.3896218117854002, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6397000', 'n_tokens_mistral': 1703, 'n_tokens_neox': 1635, 'n_words': 246}