id int64 0 458k | file_name stringlengths 4 119 | file_path stringlengths 14 227 | content stringlengths 24 9.96M | size int64 24 9.96M | language stringclasses 1
value | extension stringclasses 14
values | total_lines int64 1 219k | avg_line_length float64 2.52 4.63M | max_line_length int64 5 9.91M | alphanum_fraction float64 0 1 | repo_name stringlengths 7 101 | repo_stars int64 100 139k | repo_forks int64 0 26.4k | repo_open_issues int64 0 2.27k | repo_license stringclasses 12
values | repo_extraction_date stringclasses 433
values |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2,700 | storage.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/staticfiles/storage.py | import os
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.files.storage import FileSystemStorage
from django.utils.importlib import import_module
from django.contrib.staticfiles import utils
class StaticFilesStorage(FileSystemStorage):
"""
Standard fi... | 2,080 | Python | .py | 48 | 35.75 | 85 | 0.654644 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,701 | finders.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/staticfiles/finders.py | import os
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.files.storage import default_storage, Storage, FileSystemStorage
from django.utils.datastructures import SortedDict
from django.utils.functional import memoize, LazyObject
from django.utils.importlib impo... | 9,183 | Python | .py | 236 | 29 | 81 | 0.594461 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,702 | views.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/staticfiles/views.py | """
Views and functions for serving static files. These are only to be used during
development, and SHOULD NOT be used in a production setting.
"""
import os
import posixpath
import urllib
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.http import Http404
from dja... | 1,419 | Python | .py | 31 | 39.806452 | 78 | 0.712319 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,703 | collectstatic.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/staticfiles/management/commands/collectstatic.py | import os
import sys
import shutil
from optparse import make_option
from django.conf import settings
from django.core.files.storage import get_storage_class
from django.core.management.base import CommandError, NoArgsCommand
from django.utils.encoding import smart_str
from django.contrib.staticfiles import finders
c... | 8,992 | Python | .py | 189 | 34.851852 | 92 | 0.572371 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,704 | runserver.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/staticfiles/management/commands/runserver.py | from optparse import make_option
from django.conf import settings
from django.core.management.commands.runserver import BaseRunserverCommand
from django.contrib.staticfiles.handlers import StaticFilesHandler
class Command(BaseRunserverCommand):
option_list = BaseRunserverCommand.option_list + (
make_opti... | 1,264 | Python | .py | 23 | 47.347826 | 96 | 0.704931 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,705 | findstatic.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/staticfiles/management/commands/findstatic.py | import os
from optparse import make_option
from django.core.management.base import LabelCommand
from django.utils.encoding import smart_str, smart_unicode
from django.contrib.staticfiles import finders
class Command(LabelCommand):
help = "Finds the absolute paths for the given static file(s)."
args = "[file .... | 1,230 | Python | .py | 28 | 34.821429 | 78 | 0.606339 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,706 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/admin/models.py | from django.db import models
from django.contrib.contenttypes.models import ContentType
from django.contrib.auth.models import User
from django.contrib.admin.util import quote
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import smart_unicode
from django.utils.safestring import mark... | 2,207 | Python | .py | 47 | 41.106383 | 134 | 0.699814 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,707 | util.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/admin/util.py | from django.db import models
from django.db.models.sql.constants import LOOKUP_SEP
from django.db.models.deletion import Collector
from django.db.models.related import RelatedObject
from django.forms.forms import pretty_name
from django.utils import formats
from django.utils.html import escape
from django.utils.safestr... | 12,852 | Python | .py | 329 | 30.215805 | 94 | 0.606338 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,708 | options.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/admin/options.py | from django import forms, template
from django.forms.formsets import all_valid
from django.forms.models import (modelform_factory, modelformset_factory,
inlineformset_factory, BaseInlineFormSet)
from django.contrib.contenttypes.models import ContentType
from django.contrib.admin import widgets, helpers
from django.... | 58,170 | Python | .py | 1,189 | 37.481077 | 173 | 0.60233 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,709 | sites.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/admin/sites.py | import re
from django import http, template
from django.contrib.admin import ModelAdmin, actions
from django.contrib.admin.forms import AdminAuthenticationForm
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.contrib.contenttypes import views as contenttype_views
from django.views.decorators.csrf import ... | 17,393 | Python | .py | 378 | 34.420635 | 104 | 0.594128 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,710 | filterspecs.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/admin/filterspecs.py | """
FilterSpec encapsulates the logic for displaying filters in the Django admin.
Filters are specified in models with the "list_filter" option.
Each filter subclass knows how to display a filter for a field that passes a
certain test -- e.g. being a DateField or ForeignKey.
"""
from django.db import models
from djan... | 12,383 | Python | .py | 240 | 36.7125 | 79 | 0.544779 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,711 | __init__.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/admin/__init__.py | # ACTION_CHECKBOX_NAME is unused, but should stay since its import from here
# has been referenced in documentation.
from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME
from django.contrib.admin.options import ModelAdmin, HORIZONTAL, VERTICAL
from django.contrib.admin.options import StackedInline, TabularInli... | 1,608 | Python | .py | 33 | 40.909091 | 78 | 0.699363 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,712 | validation.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/admin/validation.py | from django.core.exceptions import ImproperlyConfigured
from django.db import models
from django.db.models.fields import FieldDoesNotExist
from django.forms.models import (BaseModelForm, BaseModelFormSet, fields_for_model,
_get_foreign_key)
from django.contrib.admin.util import get_fields_from_path, NotRelationFiel... | 19,088 | Python | .py | 352 | 40.988636 | 146 | 0.571994 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,713 | widgets.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/admin/widgets.py | """
Form Widget classes specific to the Django admin site.
"""
import django.utils.copycompat as copy
from django import forms
from django.forms.widgets import RadioFieldRenderer
from django.forms.util import flatatt
from django.utils.html import escape
from django.utils.text import truncate_words
from django.utils.t... | 12,061 | Python | .py | 257 | 38.684825 | 157 | 0.636209 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,714 | helpers.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/admin/helpers.py | from django import forms
from django.conf import settings
from django.contrib.admin.util import (flatten_fieldsets, lookup_field,
display_for_field, label_for_field, help_text_for_field)
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ObjectDoesNotExist
from django.db.m... | 13,361 | Python | .py | 307 | 33.775244 | 133 | 0.617039 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,715 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/admin/forms.py | from django import forms
from django.contrib.auth import authenticate
from django.contrib.auth.forms import AuthenticationForm
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy, ugettext as _
ERROR_MESSAGE = ugettext_lazy("Please enter a correct username and password. "
... | 1,914 | Python | .py | 36 | 39.916667 | 109 | 0.619455 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,716 | actions.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/admin/actions.py | """
Built-in, globally-available admin actions.
"""
from django import template
from django.core.exceptions import PermissionDenied
from django.contrib.admin import helpers
from django.contrib.admin.util import get_deleted_objects, model_ngettext
from django.db import router
from django.shortcuts import render_to_resp... | 3,285 | Python | .py | 72 | 38.777778 | 96 | 0.693438 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,717 | compress.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/admin/media/js/compress.py | #!/usr/bin/env python
import os
import optparse
import subprocess
import sys
here = os.path.dirname(__file__)
def main():
usage = "usage: %prog [file1..fileN]"
description = """With no file paths given this script will automatically
compress all jQuery-based files of the admin app. Requires the Google Closure... | 1,896 | Python | .py | 41 | 38.219512 | 123 | 0.617631 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,718 | admin_list.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/admin/templatetags/admin_list.py | import datetime
from django.conf import settings
from django.contrib.admin.util import lookup_field, display_for_field, label_for_field
from django.contrib.admin.views.main import (ALL_VAR, EMPTY_CHANGELIST_VALUE,
ORDER_VAR, ORDER_TYPE_VAR, PAGE_VAR, SEARCH_VAR)
from django.core.exceptions import ObjectDoesNotExis... | 13,963 | Python | .py | 302 | 35.129139 | 198 | 0.575515 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,719 | admin_modify.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/admin/templatetags/admin_modify.py | from django import template
register = template.Library()
def prepopulated_fields_js(context):
"""
Creates a list of prepopulated_fields that should render Javascript for
the prepopulated fields for both the admin form and inlines.
"""
prepopulated_fields = []
if context['add'] and 'adminform'... | 2,389 | Python | .py | 52 | 37.980769 | 128 | 0.657523 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,720 | adminmedia.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/admin/templatetags/adminmedia.py | from django.template import Library
from django.templatetags.static import PrefixNode
register = Library()
@register.simple_tag
def admin_media_prefix():
"""
Returns the string contained in the setting ADMIN_MEDIA_PREFIX.
"""
return PrefixNode.handle_simple("ADMIN_MEDIA_PREFIX")
| 298 | Python | .py | 9 | 30.111111 | 67 | 0.777003 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,721 | log.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/admin/templatetags/log.py | from django import template
from django.contrib.admin.models import LogEntry
register = template.Library()
class AdminLogNode(template.Node):
def __init__(self, limit, varname, user):
self.limit, self.varname, self.user = limit, varname, user
def __repr__(self):
return "<GetAdminLog Node>"
... | 2,270 | Python | .py | 45 | 42.333333 | 136 | 0.642567 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,722 | main.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/admin/views/main.py | from django.contrib.admin.filterspecs import FilterSpec
from django.contrib.admin.options import IncorrectLookupParameters
from django.contrib.admin.util import quote, get_fields_from_path
from django.core.exceptions import SuspiciousOperation
from django.core.paginator import InvalidPage
from django.db import models
f... | 11,867 | Python | .py | 249 | 35.016064 | 181 | 0.579206 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,723 | decorators.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/admin/views/decorators.py | try:
from functools import wraps
except ImportError:
from django.utils.functional import wraps # Python 2.4 fallback.
from django.utils.translation import ugettext as _
from django.contrib.admin.forms import AdminAuthenticationForm
from django.contrib.auth.views import login
from django.contrib.auth import RE... | 1,381 | Python | .py | 29 | 39.896552 | 210 | 0.682728 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,724 | constants.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/messages/constants.py | DEBUG = 10
INFO = 20
SUCCESS = 25
WARNING = 30
ERROR = 40
DEFAULT_TAGS = {
DEBUG: 'debug',
INFO: 'info',
SUCCESS: 'success',
WARNING: 'warning',
ERROR: 'error',
}
| 184 | Python | .py | 12 | 12.583333 | 23 | 0.614035 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,725 | api.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/messages/api.py | from django.contrib.messages import constants
from django.contrib.messages.storage import default_storage
from django.utils.functional import lazy, memoize
__all__ = (
'add_message', 'get_messages',
'get_level', 'set_level',
'debug', 'info', 'success', 'warning', 'error',
)
class MessageFailure(Exception... | 3,570 | Python | .py | 89 | 33.52809 | 78 | 0.66522 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,726 | context_processors.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/messages/context_processors.py | from django.contrib.messages.api import get_messages
def messages(request):
"""
Returns a lazy 'messages' context variable.
"""
return {'messages': get_messages(request)}
| 189 | Python | .py | 6 | 27.5 | 52 | 0.718232 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,727 | utils.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/messages/utils.py | from django.conf import settings
from django.contrib.messages import constants
def get_level_tags():
"""
Returns the message level tags.
"""
level_tags = constants.DEFAULT_TAGS.copy()
level_tags.update(getattr(settings, 'MESSAGE_TAGS', {}))
return level_tags
| 285 | Python | .py | 9 | 27.777778 | 60 | 0.722628 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,728 | middleware.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/messages/middleware.py | from django.conf import settings
from django.contrib.messages.storage import default_storage
class MessageMiddleware(object):
"""
Middleware that handles temporary messages.
"""
def process_request(self, request):
request._messages = default_storage(request)
def process_response(self, re... | 957 | Python | .py | 21 | 37.666667 | 79 | 0.676692 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,729 | user_messages.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/messages/storage/user_messages.py | """
Storages used to assist in the deprecation of contrib.auth User messages.
"""
from django.contrib.messages import constants
from django.contrib.messages.storage.base import BaseStorage, Message
from django.contrib.auth.models import User
from django.contrib.messages.storage.fallback import FallbackStorage
class ... | 2,303 | Python | .py | 54 | 35.388889 | 78 | 0.676641 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,730 | fallback.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/messages/storage/fallback.py | from django.contrib.messages.storage.base import BaseStorage
from django.contrib.messages.storage.cookie import CookieStorage
from django.contrib.messages.storage.session import SessionStorage
class FallbackStorage(BaseStorage):
"""
Tries to store all messages in the first backend, storing any unstored
mes... | 2,171 | Python | .py | 49 | 33.510204 | 78 | 0.619745 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,731 | __init__.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/messages/storage/__init__.py | from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.importlib import import_module
def get_storage(import_path):
"""
Imports the message storage class described by import_path, where
import_path is the full Python path to the class.
"""
try:
... | 1,183 | Python | .py | 27 | 36.666667 | 80 | 0.671875 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,732 | base.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/messages/storage/base.py | from django.conf import settings
from django.utils.encoding import force_unicode, StrAndUnicode
from django.contrib.messages import constants, utils
LEVEL_TAGS = utils.get_level_tags()
class Message(StrAndUnicode):
"""
Represents an actual message that can be stored in any of the supported
storage class... | 6,134 | Python | .py | 147 | 32.768707 | 79 | 0.617504 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,733 | cookie.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/messages/storage/cookie.py | from django.conf import settings
from django.contrib.messages import constants
from django.contrib.messages.storage.base import BaseStorage, Message
from django.http import SimpleCookie
from django.utils import simplejson as json
from django.utils.crypto import salted_hmac, constant_time_compare
class MessageEncoder(... | 5,983 | Python | .py | 134 | 34.641791 | 86 | 0.621849 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,734 | session.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/messages/storage/session.py | from django.contrib.messages.storage.base import BaseStorage
class SessionStorage(BaseStorage):
"""
Stores messages in the session (that is, django.contrib.sessions).
"""
session_key = '_messages'
def __init__(self, request, *args, **kwargs):
assert hasattr(request, 'session'), "The sessi... | 1,213 | Python | .py | 28 | 35 | 78 | 0.638136 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,735 | user_messages.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/messages/tests/user_messages.py | from django import http
from django.contrib.auth.models import User
from django.contrib.messages.storage.user_messages import UserMessagesStorage,\
LegacyFallbackStorage
from django.contrib.messages.tests.base import skipUnlessAuthIsInstalled
from django.contrib.messages.tests.cookie import set_cookie_data
from dja... | 2,619 | Python | .py | 53 | 42.509434 | 79 | 0.724206 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,736 | fallback.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/messages/tests/fallback.py | from django.contrib.messages import constants
from django.contrib.messages.storage.fallback import FallbackStorage, \
CookieStorage
from django.contrib.messages.tests.base import BaseTest
from django.contrib.messages.tests.cookie import set_cookie_data, \
stored_cookie_messages_count
from django.contrib.message... | 6,978 | Python | .py | 139 | 41.194245 | 79 | 0.672938 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,737 | urls.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/messages/tests/urls.py | from django.conf.urls.defaults import *
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect, HttpResponse
from django.shortcuts import render_to_response, redirect
from django.template import RequestContext, Template
from django.template.response... | 2,019 | Python | .py | 50 | 35.62 | 91 | 0.713412 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,738 | __init__.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/messages/tests/__init__.py | from django.contrib.messages.tests.cookie import CookieTest
from django.contrib.messages.tests.fallback import FallbackTest
from django.contrib.messages.tests.middleware import MiddlewareTest
from django.contrib.messages.tests.session import SessionTest
from django.contrib.messages.tests.user_messages import \
... | 392 | Python | .py | 6 | 57.166667 | 79 | 0.787565 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,739 | base.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/messages/tests/base.py | import warnings
from django import http
from django.test import TestCase
from django.conf import settings
from django.utils.translation import ugettext_lazy
from django.utils.unittest import skipIf
from django.contrib.messages import constants, utils, get_level, set_level
from django.contrib.messages.api import Messag... | 17,772 | Python | .py | 385 | 35.823377 | 89 | 0.629089 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,740 | middleware.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/messages/tests/middleware.py | from django import http
from django.contrib.messages.middleware import MessageMiddleware
from django.utils import unittest
class MiddlewareTest(unittest.TestCase):
def setUp(self):
self.middleware = MessageMiddleware()
def test_response_without_messages(self):
"""
Makes sure that the... | 546 | Python | .py | 14 | 32.571429 | 75 | 0.725379 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,741 | cookie.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/messages/tests/cookie.py | from django.contrib.messages import constants
from django.contrib.messages.tests.base import BaseTest
from django.contrib.messages.storage.cookie import CookieStorage, \
MessageEncoder, MessageDecoder
from django.contrib.messages.storage.base import Message
from django.utils ... | 5,768 | Python | .py | 123 | 38.252033 | 98 | 0.655589 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,742 | session.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/messages/tests/session.py | from django.contrib.messages.tests.base import BaseTest
from django.contrib.messages.storage.session import SessionStorage
def set_session_data(storage, messages):
"""
Sets the messages into the backend request's session and remove the
backend's loaded data cache.
"""
storage.request.session[stora... | 1,230 | Python | .py | 29 | 36.137931 | 71 | 0.709732 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,743 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/flatpages/models.py | from django.db import models
from django.contrib.sites.models import Site
from django.utils.translation import ugettext_lazy as _
class FlatPage(models.Model):
url = models.CharField(_('URL'), max_length=100, db_index=True)
title = models.CharField(_('title'), max_length=200)
content = models.TextField(_(... | 1,134 | Python | .py | 21 | 48.190476 | 163 | 0.685018 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,744 | urls.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/flatpages/urls.py | from django.conf.urls.defaults import *
urlpatterns = patterns('django.contrib.flatpages.views',
(r'^(?P<url>.*)$', 'flatpage'),
)
| 136 | Python | .py | 4 | 31.75 | 56 | 0.694656 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,745 | admin.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/flatpages/admin.py | from django import forms
from django.contrib import admin
from django.contrib.flatpages.models import FlatPage
from django.utils.translation import ugettext_lazy as _
class FlatpageForm(forms.ModelForm):
url = forms.RegexField(label=_("URL"), max_length=100, regex=r'^[-\w/\.~]+$',
help_text = _("Example: ... | 1,089 | Python | .py | 22 | 42.772727 | 133 | 0.647502 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,746 | middleware.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/flatpages/middleware.py | from django.contrib.flatpages.views import flatpage
from django.http import Http404
from django.conf import settings
class FlatpageFallbackMiddleware(object):
def process_response(self, request, response):
if response.status_code != 404:
return response # No need to check for a flatpage for non... | 710 | Python | .py | 17 | 33.176471 | 84 | 0.679191 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,747 | views.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/flatpages/views.py | from django.contrib.flatpages.models import FlatPage
from django.template import loader, RequestContext
from django.shortcuts import get_object_or_404
from django.http import HttpResponse, HttpResponseRedirect
from django.conf import settings
from django.core.xheaders import populate_xheaders
from django.utils.safestri... | 2,613 | Python | .py | 58 | 40.568966 | 86 | 0.735975 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,748 | flatpages.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/flatpages/templatetags/flatpages.py | from django import template
from django.conf import settings
from django.contrib.flatpages.models import FlatPage
register = template.Library()
class FlatpageNode(template.Node):
def __init__(self, context_name, starts_with=None, user=None):
self.context_name = context_name
if starts_with:
... | 3,467 | Python | .py | 78 | 35.589744 | 74 | 0.636687 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,749 | urls.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/flatpages/tests/urls.py | from django.conf.urls.defaults import *
# special urls for flatpage test cases
urlpatterns = patterns('',
(r'^flatpage_root', include('django.contrib.flatpages.urls')),
(r'^accounts/', include('django.contrib.auth.urls')),
)
| 235 | Python | .py | 6 | 36.5 | 66 | 0.726872 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,750 | csrf.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/flatpages/tests/csrf.py | import os
from django.conf import settings
from django.contrib.auth.models import User
from django.test import TestCase, Client
class FlatpageCSRFTests(TestCase):
fixtures = ['sample_flatpages']
urls = 'django.contrib.flatpages.tests.urls'
def setUp(self):
self.client = Client(enforce_csrf_checks=... | 3,780 | Python | .py | 68 | 47.25 | 118 | 0.692786 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,751 | __init__.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/flatpages/tests/__init__.py | from django.contrib.flatpages.tests.csrf import *
from django.contrib.flatpages.tests.forms import *
from django.contrib.flatpages.tests.middleware import *
from django.contrib.flatpages.tests.templatetags import *
from django.contrib.flatpages.tests.views import *
| 266 | Python | .py | 5 | 52.2 | 57 | 0.846743 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,752 | templatetags.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/flatpages/tests/templatetags.py | import os
from django.conf import settings
from django.contrib.auth.models import AnonymousUser, User
from django.template import Template, Context, TemplateSyntaxError
from django.test import TestCase
class FlatpageTemplateTagTests(TestCase):
fixtures = ['sample_flatpages']
urls = 'django.contrib.flatpages.te... | 5,965 | Python | .py | 121 | 36.669421 | 101 | 0.57503 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,753 | middleware.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/flatpages/tests/middleware.py | import os
from django.conf import settings
from django.contrib.auth.models import User
from django.test import TestCase
class FlatpageMiddlewareTests(TestCase):
fixtures = ['sample_flatpages']
urls = 'django.contrib.flatpages.tests.urls'
def setUp(self):
self.old_MIDDLEWARE_CLASSES = settings.MIDD... | 3,308 | Python | .py | 61 | 45.934426 | 107 | 0.689006 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,754 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/flatpages/tests/forms.py | from django.conf import settings
from django.contrib.flatpages.admin import FlatpageForm
from django.test import TestCase
class FlatpageAdminFormTests(TestCase):
def setUp(self):
self.form_data = {
'title': "A test page",
'content': "This is a test",
'sites': [settings.S... | 1,271 | Python | .py | 20 | 55.8 | 115 | 0.670673 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,755 | views.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/flatpages/tests/views.py | import os
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.flatpages.models import FlatPage
from django.test import TestCase
class FlatpageViewTests(TestCase):
fixtures = ['sample_flatpages']
urls = 'django.contrib.flatpages.tests.urls'
def setUp(self):
... | 3,360 | Python | .py | 65 | 43.153846 | 121 | 0.683105 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,756 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/sessions/models.py | import base64
import cPickle as pickle
from django.db import models
from django.utils.translation import ugettext_lazy as _
class SessionManager(models.Manager):
def encode(self, session_dict):
"""
Returns the given session dictionary pickled and encoded as a string.
"""
return Se... | 2,034 | Python | .py | 45 | 38.533333 | 77 | 0.702074 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,757 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/sessions/tests.py | import base64
from datetime import datetime, timedelta
import pickle
import shutil
import tempfile
from django.conf import settings
from django.contrib.sessions.backends.db import SessionStore as DatabaseSession
from django.contrib.sessions.backends.cache import SessionStore as CacheSession
from django.contrib.session... | 14,162 | Python | .py | 300 | 38.436667 | 91 | 0.670778 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,758 | middleware.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/sessions/middleware.py | import time
from django.conf import settings
from django.utils.cache import patch_vary_headers
from django.utils.http import cookie_date
from django.utils.importlib import import_module
class SessionMiddleware(object):
def process_request(self, request):
engine = import_module(settings.SESSION_ENGINE)
... | 1,888 | Python | .py | 40 | 34.325 | 79 | 0.611924 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,759 | db.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/sessions/backends/db.py | import datetime
from django.conf import settings
from django.contrib.sessions.backends.base import SessionBase, CreateError
from django.core.exceptions import SuspiciousOperation
from django.db import IntegrityError, transaction, router
from django.utils.encoding import force_unicode
class SessionStore(SessionBase):
... | 2,756 | Python | .py | 73 | 27.753425 | 79 | 0.611818 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,760 | cached_db.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/sessions/backends/cached_db.py | """
Cached, database-backed sessions.
"""
from django.conf import settings
from django.contrib.sessions.backends.db import SessionStore as DBStore
from django.core.cache import cache
class SessionStore(DBStore):
"""
Implements cached, database backed sessions.
"""
def __init__(self, session_key=None)... | 1,256 | Python | .py | 34 | 30.205882 | 79 | 0.670782 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,761 | file.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/sessions/backends/file.py | import errno
import os
import tempfile
from django.conf import settings
from django.contrib.sessions.backends.base import SessionBase, CreateError
from django.core.exceptions import SuspiciousOperation, ImproperlyConfigured
class SessionStore(SessionBase):
"""
Implements a file based session store.
"""
... | 5,367 | Python | .py | 128 | 30.609375 | 78 | 0.590073 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,762 | cache.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/sessions/backends/cache.py | from django.contrib.sessions.backends.base import SessionBase, CreateError
from django.core.cache import cache
class SessionStore(SessionBase):
"""
A cache-based session store.
"""
def __init__(self, session_key=None):
self._cache = cache
super(SessionStore, self).__init__(session_key)
... | 1,881 | Python | .py | 49 | 28.836735 | 79 | 0.604932 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,763 | base.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/sessions/backends/base.py | import base64
import os
import random
import sys
import time
from datetime import datetime, timedelta
try:
import cPickle as pickle
except ImportError:
import pickle
from django.conf import settings
from django.core.exceptions import SuspiciousOperation
from django.utils.hashcompat import md5_constructor
from ... | 10,286 | Python | .py | 261 | 30.51341 | 96 | 0.619487 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,764 | middleware.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/csrf/middleware.py | from django.middleware.csrf import CsrfMiddleware, CsrfViewMiddleware, CsrfResponseMiddleware
from django.views.decorators.csrf import csrf_exempt, csrf_view_exempt, csrf_response_exempt
import warnings
warnings.warn("This import for CSRF functionality is deprecated. Please use django.middleware.csrf for the middlewa... | 423 | Python | .py | 6 | 64.666667 | 169 | 0.800481 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,765 | __init__.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/sitemaps/__init__.py | from django.contrib.sites.models import Site, get_current_site
from django.core import urlresolvers, paginator
from django.core.exceptions import ImproperlyConfigured
import urllib
PING_URL = "http://www.google.com/webmasters/tools/ping"
class SitemapNotFound(Exception):
pass
def ping_google(sitemap_url=None, pi... | 4,010 | Python | .py | 92 | 34.706522 | 169 | 0.635734 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,766 | views.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/sitemaps/views.py | from django.http import HttpResponse, Http404
from django.template import loader
from django.contrib.sites.models import get_current_site
from django.core import urlresolvers
from django.utils.encoding import smart_str
from django.core.paginator import EmptyPage, PageNotAnInteger
def index(request, sitemaps, template_... | 2,084 | Python | .py | 45 | 38.688889 | 112 | 0.659303 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,767 | urls.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/sitemaps/tests/urls.py | from datetime import datetime
from django.conf.urls.defaults import *
from django.contrib.sitemaps import Sitemap, GenericSitemap, FlatPageSitemap
from django.contrib.auth.models import User
class SimpleSitemap(Sitemap):
changefreq = "never"
priority = 0.5
location = '/location/'
lastmod = datetime.now... | 1,275 | Python | .py | 31 | 37.354839 | 121 | 0.684976 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,768 | basic.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/sitemaps/tests/basic.py | import os
from datetime import date
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.sitemaps import Sitemap
from django.contrib.sites.models import Site
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase
from django.utils.unittest im... | 7,620 | Python | .py | 155 | 42.109677 | 124 | 0.674366 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,769 | ping_google.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/sitemaps/management/commands/ping_google.py | from django.core.management.base import BaseCommand
from django.contrib.sitemaps import ping_google
class Command(BaseCommand):
help = "Ping Google with an updated sitemap, pass optional url of sitemap"
def execute(self, *args, **options):
if len(args) == 1:
sitemap_url = args[0]
... | 403 | Python | .py | 10 | 33.3 | 78 | 0.681234 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,770 | signals.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/core/signals.py | from django.dispatch import Signal
request_started = Signal()
request_finished = Signal()
got_request_exception = Signal(providing_args=["request"])
| 150 | Python | .py | 4 | 36.25 | 58 | 0.8 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,771 | urlresolvers.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/core/urlresolvers.py | """
This module converts requested URLs to callback view functions.
RegexURLResolver is the main class here. Its resolve() method takes a URL (as
a string) and returns a tuple in this format:
(view_function, function_args, function_kwargs)
"""
import re
from threading import local
from django.http import Http40... | 17,094 | Python | .py | 379 | 34.688654 | 190 | 0.599892 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,772 | paginator.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/core/paginator.py | from math import ceil
class InvalidPage(Exception):
pass
class PageNotAnInteger(InvalidPage):
pass
class EmptyPage(InvalidPage):
pass
class Paginator(object):
def __init__(self, object_list, per_page, orphans=0, allow_empty_first_page=True):
self.object_list = object_list
self.per_pa... | 4,021 | Python | .py | 101 | 30.742574 | 86 | 0.610613 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,773 | xheaders.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/core/xheaders.py | """
Pages in Django can are served up with custom HTTP headers containing useful
information about those pages -- namely, the content type and object ID.
This module contains utility functions for retrieving and doing interesting
things with these special "X-Headers" (so called because the HTTP spec demands
that custo... | 1,157 | Python | .py | 21 | 50.333333 | 102 | 0.721977 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,774 | context_processors.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/core/context_processors.py | """
A set of request processors that return dictionaries to be merged into a
template context. Each function takes the request object as its only parameter
and returns a dictionary to add to the context.
These are referenced from the setting TEMPLATE_CONTEXT_PROCESSORS and used by
RequestContext.
"""
from django.conf... | 3,868 | Python | .py | 94 | 35.095745 | 88 | 0.704927 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,775 | template_loader.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/core/template_loader.py | # This module is DEPRECATED!
#
# You should no longer be using django.template_loader.
#
# Use django.template.loader instead.
from django.template.loader import *
| 165 | Python | .py | 6 | 26.333333 | 55 | 0.797468 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,776 | validators.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/core/validators.py | import re
import urllib2
import urlparse
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import smart_unicode
# These values, if given to validate(), will trigger the self.required check.
EMPTY_VALUES = (None, '', [], (), {})
try:
... | 7,266 | Python | .py | 161 | 35.354037 | 140 | 0.572499 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,777 | exceptions.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/core/exceptions.py | """
Global Django exception and warning classes.
"""
class DjangoRuntimeWarning(RuntimeWarning):
pass
class ObjectDoesNotExist(Exception):
"The requested object does not exist"
silent_variable_failure = True
class MultipleObjectsReturned(Exception):
"The query returned multiple objects when only one w... | 2,767 | Python | .py | 72 | 30.902778 | 77 | 0.660075 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,778 | uploadedfile.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/core/files/uploadedfile.py | """
Classes representing uploaded files.
"""
import os
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
from django.conf import settings
from django.core.files.base import File
from django.core.files import temp as tempfile
from django.utils.encoding import smart_str
__al... | 4,225 | Python | .py | 105 | 31.866667 | 92 | 0.624115 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,779 | uploadhandler.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/core/files/uploadhandler.py | """
Base file upload handler classes, and the built-in concrete subclasses
"""
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.files.uploadedfile import TemporaryUplo... | 7,028 | Python | .py | 182 | 30.785714 | 135 | 0.643182 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,780 | temp.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/core/files/temp.py | """
The temp module provides a NamedTemporaryFile that can be re-opened on any
platform. Most platforms use the standard Python tempfile.TemporaryFile class,
but MS Windows users are given a custom class.
This is needed because in Windows NT, the default implementation of
NamedTemporaryFile uses the O_TEMPORARY flag, ... | 1,819 | Python | .py | 46 | 29.847826 | 78 | 0.61713 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,781 | images.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/core/files/images.py | """
Utility functions for handling images.
Requires PIL, as you might imagine.
"""
from django.core.files import File
class ImageFile(File):
"""
A mixin for use alongside django.core.files.base.File, which provides
additional features for dealing with images.
"""
def _get_width(self):
ret... | 1,733 | Python | .py | 55 | 24.054545 | 79 | 0.612208 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,782 | utils.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/core/files/utils.py | class FileProxyMixin(object):
"""
A mixin class used to forward file methods to an underlaying file
object. The internal file object has to be called "file"::
class FileProxy(FileProxyMixin):
def __init__(self, file):
self.file = file
"""
encoding = property(la... | 1,230 | Python | .py | 26 | 41.269231 | 69 | 0.705246 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,783 | move.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/core/files/move.py | """
Move a file in the safest way possible::
>>> from django.core.files.move import file_move_safe
>>> file_move_safe("/tmp/old_file", "/tmp/new_file")
"""
import os
from django.core.files import locks
try:
from shutil import copystat
except ImportError:
import stat
def copystat(src, dst):
... | 2,931 | Python | .py | 75 | 31.213333 | 94 | 0.616954 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,784 | storage.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/core/files/storage.py | import os
import errno
import urlparse
import itertools
from datetime import datetime
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured, SuspiciousOperation
from django.core.files import locks, File
from django.core.files.move import file_move_safe
from django.utils.encoding impo... | 9,878 | Python | .py | 231 | 33.450216 | 110 | 0.626263 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,785 | base.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/core/files/base.py | import os
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
from django.utils.encoding import smart_str, smart_unicode
from django.core.files.utils import FileProxyMixin
class File(FileProxyMixin):
DEFAULT_CHUNK_SIZE = 64 * 2**10
def __init__(self, file, name=None)... | 3,888 | Python | .py | 110 | 26.072727 | 80 | 0.567769 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,786 | locks.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/core/files/locks.py | """
Portable file locking utilities.
Based partially on example by Jonathan Feignberg <jdf@pobox.com> in the Python
Cookbook, licensed under the Python Software License.
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65203
Example Usage::
>>> from django.core.files import locks
>>> f = open('./... | 1,791 | Python | .py | 56 | 27.303571 | 78 | 0.668797 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,787 | message.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/core/mail/message.py | import mimetypes
import os
import random
import time
from email import Charset, Encoders
try:
from email.generator import Generator
except ImportError:
from email.Generator import Generator # TODO: Remove when remove Python 2.4 support
from email.MIMEText import MIMEText
from email.MIMEMultipart import MIMEMult... | 12,967 | Python | .py | 311 | 33.385852 | 126 | 0.641095 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,788 | utils.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/core/mail/utils.py | """
Email message and email sending related helper functions.
"""
import socket
# Cache the hostname, but do it lazily: socket.getfqdn() can take a couple of
# seconds, which slows down the restart of the server.
class CachedDnsName(object):
def __str__(self):
return self.get_fqdn()
def get_fqdn(sel... | 459 | Python | .py | 14 | 28.285714 | 77 | 0.684091 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,789 | __init__.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/core/mail/__init__.py | """
Tools for sending email.
"""
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.importlib import import_module
# Imported for backwards compatibility, and for the sake
# of a cleaner namespace. These symbols used to be in
# django/core/mail.py before the int... | 5,072 | Python | .py | 100 | 42.28 | 85 | 0.682011 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,790 | locmem.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/core/mail/backends/locmem.py | """
Backend for test environment.
"""
from django.core import mail
from django.core.mail.backends.base import BaseEmailBackend
class EmailBackend(BaseEmailBackend):
"""A email backend for use during test sessions.
The test connection stores email messages in a dummy outbox,
rather than sending them out o... | 743 | Python | .py | 19 | 33.631579 | 73 | 0.696801 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,791 | console.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/core/mail/backends/console.py | """
Email backend that writes messages to console instead of sending them.
"""
import sys
import threading
from django.core.mail.backends.base import BaseEmailBackend
class EmailBackend(BaseEmailBackend):
def __init__(self, *args, **kwargs):
self.stream = kwargs.pop('stream', sys.stdout)
self._loc... | 1,295 | Python | .py | 34 | 27.117647 | 77 | 0.562798 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,792 | base.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/core/mail/backends/base.py | """Base email backend class."""
class BaseEmailBackend(object):
"""
Base class for email backend implementations.
Subclasses must at least overwrite send_messages().
"""
def __init__(self, fail_silently=False, **kwargs):
self.fail_silently = fail_silently
def open(self):
"""Op... | 1,164 | Python | .py | 30 | 31.1 | 78 | 0.666667 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,793 | filebased.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/core/mail/backends/filebased.py | """Email backend that writes messages to a file."""
import datetime
import os
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.mail.backends.console import EmailBackend as ConsoleEmailBackend
class EmailBackend(ConsoleEmailBackend):
def __init__(self, *arg... | 2,485 | Python | .py | 52 | 38.5 | 131 | 0.629843 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,794 | smtp.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/core/mail/backends/smtp.py | """SMTP email backend class."""
import smtplib
import socket
import threading
from django.conf import settings
from django.core.mail.backends.base import BaseEmailBackend
from django.core.mail.utils import DNS_NAME
from django.core.mail.message import sanitize_address
class EmailBackend(BaseEmailBackend):
"""
... | 3,878 | Python | .py | 102 | 26.617647 | 87 | 0.575219 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,795 | dummy.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/core/mail/backends/dummy.py | """
Dummy email backend that does nothing.
"""
from django.core.mail.backends.base import BaseEmailBackend
class EmailBackend(BaseEmailBackend):
def send_messages(self, email_messages):
return len(email_messages)
| 227 | Python | .py | 7 | 29.428571 | 59 | 0.784404 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,796 | profiler-hotshot.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/core/handlers/profiler-hotshot.py | import hotshot, time, os
from django.core.handlers.modpython import ModPythonHandler
PROFILE_DATA_DIR = "/var/log/cmsprofile"
def handler(req):
'''
Handler that uses hotshot to store profile data.
Stores profile data in PROFILE_DATA_DIR. Since hotshot has no way (that I
know of) to append profile da... | 934 | Python | .py | 18 | 47.555556 | 83 | 0.719298 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,797 | base.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/core/handlers/base.py | import sys
from django import http
from django.core import signals
from django.utils.encoding import force_unicode
from django.utils.importlib import import_module
from django.utils.log import getLogger
logger = getLogger('django.request')
class BaseHandler(object):
# Changes that are always applied to a respon... | 11,468 | Python | .py | 221 | 37.59276 | 136 | 0.591922 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,798 | modpython.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/core/handlers/modpython.py | import os
from pprint import pformat
import sys
from warnings import warn
from django import http
from django.core import signals
from django.core.handlers.base import BaseHandler
from django.core.urlresolvers import set_script_prefix
from django.utils import datastructures
from django.utils.encoding import force_unic... | 8,279 | Python | .py | 185 | 34.367568 | 99 | 0.588148 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,799 | wsgi.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/core/handlers/wsgi.py | from pprint import pformat
import sys
from threading import Lock
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
import socket
from django import http
from django.core import signals
from django.core.handlers import base
from django.core.urlresolvers import set_script_pref... | 10,193 | Python | .py | 260 | 29.738462 | 140 | 0.590753 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |