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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
20,200 | views.py | django-wiki_django-wiki/src/wiki/plugins/globalhistory/views.py | from django.contrib.auth.decorators import login_required
from django.db.models import F
from django.utils.decorators import method_decorator
from django.views.generic import ListView
from wiki import models
from wiki.core.paginator import WikiPaginator
class GlobalHistory(ListView):
template_name = "wiki/plugins... | 1,213 | Python | .py | 30 | 32.733333 | 75 | 0.664686 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,201 | models.py | django-wiki_django-wiki/src/wiki/plugins/notifications/models.py | from django.db import models
from django.db.models import signals
from django.urls import reverse
from django.utils.translation import gettext_lazy as _
from django_nyt.models import Subscription
from django_nyt.utils import notify
from wiki import models as wiki_models
from wiki.decorators import disable_signal_for_lo... | 2,644 | Python | .py | 66 | 31.621212 | 79 | 0.65446 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,202 | util.py | django-wiki_django-wiki/src/wiki/plugins/notifications/util.py | from django.utils.translation import gettext as _
def get_title(article):
"""Utility function to format the title of an article..."""
return truncate_title(article.title)
def truncate_title(title):
"""Truncate a title (of an article, file, image etc) to be displayed in notifications messages."""
if ... | 435 | Python | .py | 11 | 34.545455 | 102 | 0.67381 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,203 | settings.py | django-wiki_django-wiki/src/wiki/plugins/notifications/settings.py | # Deprecated
APP_LABEL = None
# Key for django_nyt - changing it will break any existing notifications.
ARTICLE_EDIT = "article_edit"
SLUG = "notifications"
| 159 | Python | .py | 5 | 30.4 | 73 | 0.782895 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,204 | apps.py | django-wiki_django-wiki/src/wiki/plugins/notifications/apps.py | from django.apps import AppConfig
from django.db.models import signals
from django.utils.translation import gettext_lazy as _
class NotificationsConfig(AppConfig):
name = "wiki.plugins.notifications"
verbose_name = _("Wiki notifications")
label = "wiki_notifications"
def ready(self):
"""
... | 1,967 | Python | .py | 46 | 27.347826 | 78 | 0.529258 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,205 | wiki_plugin.py | django-wiki_django-wiki/src/wiki/plugins/notifications/wiki_plugin.py | from django.urls import re_path
from wiki.core.plugins import registry
from wiki.core.plugins.base import BasePlugin
from . import settings
from . import views
class NotifyPlugin(BasePlugin):
slug = settings.SLUG
urlpatterns = {
"root": [
re_path(
r"^$",
vi... | 598 | Python | .py | 19 | 24.421053 | 71 | 0.664336 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,206 | forms.py | django-wiki_django-wiki/src/wiki/plugins/notifications/forms.py | from django import forms
from django.contrib.contenttypes.models import ContentType
from django.forms.models import BaseModelFormSet
from django.forms.models import modelformset_factory
from django.utils.safestring import mark_safe
from django.utils.translation import gettext
from django.utils.translation import gettex... | 8,008 | Python | .py | 200 | 28.4 | 91 | 0.58282 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,207 | views.py | django-wiki_django-wiki/src/wiki/plugins/notifications/views.py | from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.shortcuts import redirect
from django.utils.decorators import method_decorator
from django.utils.translation import gettext as _
from django.views.generic import FormView
from . import forms
from . import models
... | 2,150 | Python | .py | 54 | 29.037037 | 70 | 0.600096 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,208 | 0002_auto_20151118_1811.py | django-wiki_django-wiki/src/wiki/plugins/notifications/migrations/0002_auto_20151118_1811.py | from django.db import migrations
class Migration(migrations.Migration):
atomic = False
dependencies = [
("wiki_notifications", "0001_initial"),
]
operations = [
migrations.AlterModelTable(
name="articlesubscription",
table="wiki_notifications_articlesubscript... | 343 | Python | .py | 12 | 21.5 | 59 | 0.647239 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,209 | 0001_initial.py | django-wiki_django-wiki/src/wiki/plugins/notifications/migrations/0001_initial.py | from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
dependencies = [
("django_nyt", "0006_auto_20141229_1630"),
("wiki", "0001_initial"),
]
operations = [
migrations.CreateModel(
name="ArticleSubscription",
... | 1,215 | Python | .py | 37 | 18.216216 | 78 | 0.4523 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,210 | wiki_notifications_create_defaults.py | django-wiki_django-wiki/src/wiki/plugins/notifications/management/commands/wiki_notifications_create_defaults.py | from django.contrib.auth import get_user_model
from django.contrib.contenttypes.models import ContentType
from django.core.management.base import BaseCommand
from django.utils import translation
from django_nyt.models import Settings
from django_nyt.utils import subscribe
from wiki.models import Article
from wiki.plugi... | 2,478 | Python | .py | 57 | 28.929825 | 79 | 0.556569 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,211 | settings.py | django-wiki_django-wiki/src/wiki/plugins/links/settings.py | from django.conf import settings as django_settings
#: If a relative slug is used in a wiki markdown link and no article is
#: found with the given slug starting at the current articles level a
#: link to a not yet existing article is created. Creating the article
#: can be done by following the link. This link will b... | 488 | Python | .py | 8 | 59.875 | 71 | 0.77453 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,212 | apps.py | django-wiki_django-wiki/src/wiki/plugins/links/apps.py | from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class LinksConfig(AppConfig):
name = "wiki.plugins.links"
verbose_name = _("Wiki links")
label = "wiki_links"
| 213 | Python | .py | 6 | 32.166667 | 54 | 0.746341 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,213 | wiki_plugin.py | django-wiki_django-wiki/src/wiki/plugins/links/wiki_plugin.py | from django.urls import re_path
from django.urls import reverse_lazy
from django.utils.translation import gettext as _
from wiki.core.plugins import registry
from wiki.core.plugins.base import BasePlugin
from wiki.plugins.links import settings
from wiki.plugins.links import views
from wiki.plugins.links.mdx.djangowikil... | 1,217 | Python | .py | 36 | 27.166667 | 79 | 0.651618 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,214 | views.py | django-wiki_django-wiki/src/wiki/plugins/links/views.py | from django.utils.decorators import method_decorator
from django.views.generic import View
from wiki import models
from wiki.core.utils import object_to_json_response
from wiki.decorators import get_article
class QueryUrlPath(View):
@method_decorator(get_article(can_read=True))
def dispatch(self, request, art... | 1,140 | Python | .py | 29 | 27.793103 | 69 | 0.564195 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,215 | urlize.py | django-wiki_django-wiki/src/wiki/plugins/links/mdx/urlize.py | import re
import xml
import markdown
# Regular expression is meant to match the following pattern:
#
# [BEGIN][PROTOCOL]HOST[:PORT][/[PATH]][END]
#
# Everything except HOST is meant to be optional, as denoted by square
# brackets.
#
# Patter elements are as follows:
#
# BEGIN
# String preceding the link. Can be emp... | 6,005 | Python | .py | 157 | 32.77707 | 92 | 0.608823 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,216 | djangowikilinks.py | django-wiki_django-wiki/src/wiki/plugins/links/mdx/djangowikilinks.py | """
Wikipath Extension for Python-Markdown
======================================
Converts [Link Name](wiki:ArticleName) to relative links pointing to article.
Basic usage:
>>> import markdown
>>> text = "Some text with a [Link Name](wiki:ArticleName)."
>>> html = markdown.markdown(text, ['wikipath(base_... | 5,175 | Python | .py | 120 | 33.266667 | 117 | 0.578162 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,217 | models.py | django-wiki_django-wiki/src/wiki/plugins/attachments/models.py | import os
from django.conf import settings as django_settings
from django.db import models
from django.db.models import signals
from django.utils.translation import gettext
from django.utils.translation import gettext_lazy as _
from wiki import managers
from wiki.decorators import disable_signal_for_loaddata
from wiki... | 7,816 | Python | .py | 205 | 29.473171 | 101 | 0.638382 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,218 | settings.py | django-wiki_django-wiki/src/wiki/plugins/attachments/settings.py | from django.conf import settings as django_settings
from django.core.exceptions import ImproperlyConfigured
from wiki.conf import settings as wiki_settings
# Deprecated
APP_LABEL = None
SLUG = "attachments"
# Please see this note about support for UTF-8 files on django/apache:
# https://docs.djangoproject.com/en/dev... | 3,565 | Python | .py | 71 | 47.690141 | 102 | 0.761631 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,219 | markdown_extensions.py | django-wiki_django-wiki/src/wiki/plugins/attachments/markdown_extensions.py | import re
import markdown
from django.contrib.auth.models import AnonymousUser
from django.template.loader import render_to_string
from django.urls import reverse
from wiki.core.markdown import add_to_registry
from wiki.core.permissions import can_read
from wiki.plugins.attachments import models
ATTACHMENT_RE = re.co... | 3,628 | Python | .py | 84 | 28.97619 | 120 | 0.528045 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,220 | urls.py | django-wiki_django-wiki/src/wiki/plugins/attachments/urls.py | from django.urls import re_path
from wiki.plugins.attachments import views
urlpatterns = [
re_path(r"^$", views.AttachmentView.as_view(), name="attachments_index"),
re_path(
r"^search/$",
views.AttachmentSearchView.as_view(),
name="attachments_search",
),
re_path(
r"^add... | 1,430 | Python | .py | 45 | 24.977778 | 82 | 0.59104 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,221 | apps.py | django-wiki_django-wiki/src/wiki/plugins/attachments/apps.py | from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class AttachmentsConfig(AppConfig):
name = "wiki.plugins.attachments"
verbose_name = _("Wiki attachments")
label = "wiki_attachments"
| 237 | Python | .py | 6 | 36.166667 | 54 | 0.772926 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,222 | wiki_plugin.py | django-wiki_django-wiki/src/wiki/plugins/attachments/wiki_plugin.py | from django.urls import include
from django.urls import re_path
from django.utils.translation import gettext as _
from wiki.core.plugins import registry
from wiki.core.plugins.base import BasePlugin
from wiki.plugins.attachments import models
from wiki.plugins.attachments import settings
from wiki.plugins.attachments i... | 1,453 | Python | .py | 36 | 33.722222 | 76 | 0.696454 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,223 | admin.py | django-wiki_django-wiki/src/wiki/plugins/attachments/admin.py | from django.contrib import admin
from . import models
class AttachmentRevisionAdmin(admin.TabularInline):
model = models.AttachmentRevision
extra = 1
fields = ("file", "user", "user_message")
class AttachmentAdmin(admin.ModelAdmin):
inlines = [AttachmentRevisionAdmin]
admin.site.register(models.A... | 348 | Python | .py | 9 | 35.111111 | 55 | 0.792169 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,224 | forms.py | django-wiki_django-wiki/src/wiki/plugins/attachments/forms.py | import tempfile
import zipfile
from django import forms
from django.core.files.uploadedfile import File
from django.utils.translation import gettext
from django.utils.translation import gettext_lazy as _
from wiki.core.permissions import can_moderate
from wiki.plugins.attachments import models
from wiki.plugins.attach... | 6,166 | Python | .py | 148 | 29.986486 | 95 | 0.595429 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,225 | views.py | django-wiki_django-wiki/src/wiki/plugins/attachments/views.py | from django.contrib import messages
from django.core.exceptions import ObjectDoesNotExist
from django.db.models import Q
from django.http import Http404
from django.http import HttpResponseRedirect
from django.shortcuts import get_object_or_404
from django.shortcuts import redirect
from django.utils.decorators import m... | 17,166 | Python | .py | 411 | 30.287105 | 141 | 0.595583 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,226 | 0001_initial.py | django-wiki_django-wiki/src/wiki/plugins/attachments/migrations/0001_initial.py | import django.db.models.deletion
import wiki.plugins.attachments.models
from django.conf import settings
from django.db import migrations
from django.db import models
from django.db.models.fields import GenericIPAddressField as IPAddressField
class Migration(migrations.Migration):
dependencies = [
("wiki... | 4,838 | Python | .py | 128 | 20.484375 | 116 | 0.439014 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,227 | 0002_auto_20151118_1816.py | django-wiki_django-wiki/src/wiki/plugins/attachments/migrations/0002_auto_20151118_1816.py | from django.db import migrations
class Migration(migrations.Migration):
atomic = False
dependencies = [
("wiki_attachments", "0001_initial"),
]
operations = [
migrations.AlterModelTable(
name="attachment",
table="wiki_attachments_attachment",
),
... | 464 | Python | .py | 16 | 20.9375 | 56 | 0.61851 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,228 | settings.py | django-wiki_django-wiki/src/wiki/conf/settings.py | import bleach
from django.conf import settings as django_settings
from django.contrib.messages import constants as messages
from django.core.files.storage import default_storage
from django.urls import reverse_lazy
from django.utils.translation import gettext_lazy as _
#: Should urls be case sensitive?
URL_CASE_SENSIT... | 11,747 | Python | .py | 262 | 41.984733 | 90 | 0.732418 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,229 | conf.py | django-wiki_django-wiki/docs/conf.py | import inspect
import os
import sys
from datetime import datetime
import bleach
import django
try:
from django.utils.encoding import force_text
except ImportError:
from django.utils.encoding import force_str as force_text
#
# django-wiki documentation build configuration file, created by
# sphinx-quickstart ... | 11,326 | Python | .py | 262 | 39.496183 | 100 | 0.689687 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,230 | settings.py | django-wiki_django-wiki/tests/settings.py | import os
from django.urls import reverse_lazy
TESTS_DATA_ROOT = os.path.dirname(__file__)
MEDIA_ROOT = os.path.join(TESTS_DATA_ROOT, "media")
DATABASES = {"default": {"ENGINE": "django.db.backends.sqlite3"}}
DEBUG = True
AUTH_USER_MODEL = "testdata.CustomUser"
WIKI_GROUP_MODEL = "testdata.CustomGroup"
SITE_ID = 1... | 2,480 | Python | .py | 63 | 33.31746 | 70 | 0.69888 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,231 | base.py | django-wiki_django-wiki/tests/base.py | import os
import unittest
import django_functest
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from django.template import Context
from django.template import Template
from django.test import override_settings
from django.test import TestCase
from django.urls import reverse
from wiki.models i... | 3,904 | Python | .py | 112 | 28.625 | 79 | 0.700214 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,232 | models.py | django-wiki_django-wiki/tests/testdata/models.py | from django.contrib.auth.base_user import AbstractBaseUser
from django.contrib.auth.models import AbstractUser
from django.db import models
class CustomUser(AbstractUser):
some_field = models.IntegerField(default=0)
custom_groups = models.ManyToManyField(
"CustomGroup",
verbose_name="groups",... | 791 | Python | .py | 22 | 29.909091 | 79 | 0.708661 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,233 | urls.py | django-wiki_django-wiki/tests/testdata/urls.py | from django.conf import settings
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.urls import include
from django.urls import re_path
urlpatterns = [
re_path(r"^admin/doc/", include("django.contrib.admindocs.urls")),
re_path(r"^admin/", admin.site... | 762 | Python | .py | 23 | 28.347826 | 70 | 0.668478 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,234 | 0001_initial.py | django-wiki_django-wiki/tests/testdata/migrations/0001_initial.py | # Generated by Django 2.2.1 on 2019-07-03 19:03
import django.contrib.auth.models
import django.contrib.auth.validators
import django.utils.timezone
from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
initial = True
dependencies = [
("auth", "0008_alt... | 6,144 | Python | .py | 167 | 18.011976 | 138 | 0.38647 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,235 | test_basic.py | django-wiki_django-wiki/tests/core/test_basic.py | import tempfile
from datetime import datetime
from django.test import TestCase
from wiki.conf import settings as wiki_settings
from wiki.core.http import send_file
from wiki.forms import Group
from wiki.models import Article
from wiki.models import ArticleRevision
from wiki.models import URLPath
from ..base import wi... | 2,085 | Python | .py | 52 | 33.096154 | 76 | 0.695695 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,236 | test_sites.py | django-wiki_django-wiki/tests/core/test_sites.py | from importlib import reload
from django.contrib.sites.models import Site
from django.test.testcases import TestCase
from django.urls import include
from django.urls import re_path
from wiki import sites
from wiki import urls
from wiki.apps import WikiConfig
from wiki.models import Article
from wiki.models import URLP... | 3,258 | Python | .py | 88 | 29.227273 | 91 | 0.646574 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,237 | test_paginator.py | django-wiki_django-wiki/tests/core/test_paginator.py | from django.test import TestCase
from wiki.core.paginator import WikiPaginator
class PaginatorTest(TestCase):
"""
Test the WikiPaginator and it's page_range() function
"""
def test_paginator(self):
objects = [1]
p = WikiPaginator(objects, 2, side_pages=2)
self.assertEqual(p.nu... | 1,097 | Python | .py | 28 | 31.214286 | 77 | 0.568053 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,238 | test_accounts.py | django-wiki_django-wiki/tests/core/test_accounts.py | from django.conf import settings as django_settings
from django.contrib import auth
from django.contrib.auth import authenticate
from django.contrib.auth.models import AnonymousUser
from django.shortcuts import resolve_url
from wiki.conf import settings as wiki_settings
from wiki.models import reverse
from ..base impo... | 5,272 | Python | .py | 130 | 31.561538 | 82 | 0.64876 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,239 | test_utils.py | django-wiki_django-wiki/tests/core/test_utils.py | from django.test import TestCase
from wiki.core.utils import object_to_json_response
class TestUtils(TestCase):
def test_object_to_json(self):
"""
Simple test, the actual serialization happens in json.dumps and we
don't wanna test this core module in depth.
"""
obj = []
... | 467 | Python | .py | 12 | 32.083333 | 74 | 0.675497 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,240 | test_template_tags.py | django-wiki_django-wiki/tests/core/test_template_tags.py | """
Almost all test cases covers both tag calling and template using.
"""
from django.conf import settings as django_settings
from django.contrib.contenttypes.models import ContentType
from django.http import HttpRequest
from wiki.conf import settings
from wiki.forms import CreateRootForm
from wiki.models import Articl... | 10,268 | Python | .py | 247 | 32.951417 | 80 | 0.625214 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,241 | test_managers.py | django-wiki_django-wiki/tests/core/test_managers.py | """
Tests that the custom queryset methods work, this is important
because the pattern of building them is different from Django
1.5 to 1.6 to 1.7 so there will be 3 patterns in play at the
same time.
"""
from wiki.models import Article
from wiki.models import URLPath
from wiki.plugins.attachments.models import Attachm... | 3,014 | Python | .py | 69 | 36.014493 | 79 | 0.675418 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,242 | test_urls.py | django-wiki_django-wiki/tests/core/test_urls.py | from django.conf.urls.static import static
from django.contrib.sites.models import Site
from django.test.testcases import TestCase
from django.urls import include
from django.urls import re_path
from wiki.models import Article
from wiki.models import URLPath
from wiki.urls import get_pattern as get_wiki_pattern
from wi... | 2,295 | Python | .py | 62 | 29.306452 | 78 | 0.640505 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,243 | test_commands.py | django-wiki_django-wiki/tests/core/test_commands.py | import os
import sys
import tempfile
from django.core.management import call_command
from ..base import ArticleTestBase
class TestManagementCommands(ArticleTestBase):
"""
This clever test case can be inherited in other plugins
Some data is created with ArticleTestBase, use that.
"""
def test_d... | 789 | Python | .py | 23 | 27.826087 | 59 | 0.680263 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,244 | test_template_filters.py | django-wiki_django-wiki/tests/core/test_template_filters.py | from django.contrib.auth import get_user_model
from wiki.models import Article
from wiki.models import ArticleRevision
from wiki.templatetags.wiki_tags import can_delete
from wiki.templatetags.wiki_tags import can_moderate
from wiki.templatetags.wiki_tags import can_read
from wiki.templatetags.wiki_tags import can_writ... | 10,883 | Python | .py | 261 | 33.482759 | 82 | 0.623205 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,245 | test_forms.py | django-wiki_django-wiki/tests/core/test_forms.py | from django.test import TestCase
from django.utils.translation import gettext
from wiki.forms import DeleteForm
from wiki.forms import UserCreationForm
from tests.base import DjangoClientTestBase
from tests.base import RequireRootArticleMixin
class DeleteFormTests(RequireRootArticleMixin, DjangoClientTestBase):
... | 1,258 | Python | .py | 34 | 28.441176 | 87 | 0.62018 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,246 | test_markdown.py | django-wiki_django-wiki/tests/core/test_markdown.py | from unittest.mock import patch
import markdown
from django.test import TestCase
from wiki.core.markdown import ArticleMarkdown
from wiki.core.markdown.mdx.codehilite import WikiCodeHiliteExtension
from wiki.core.markdown.mdx.responsivetable import ResponsiveTableExtension
from wiki.models import URLPath
from ..base ... | 4,546 | Python | .py | 113 | 29.292035 | 163 | 0.513605 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,247 | test_views.py | django-wiki_django-wiki/tests/core/test_views.py | import pprint
from django.contrib.messages import constants
from django.contrib.messages import get_messages
from django.http import JsonResponse
from django.shortcuts import resolve_url
from django.test import override_settings
from django.utils import translation
from django.utils.html import escape
from django_func... | 33,367 | Python | .py | 855 | 28.614035 | 82 | 0.571808 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,248 | test_models.py | django-wiki_django-wiki/tests/core/test_models.py | from django.apps import apps
from django.contrib.auth import get_user_model
from django.contrib.sites.models import Site
from django.test.testcases import TestCase
from django.urls import re_path
from wiki.conf import settings
from wiki.managers import ArticleManager
from wiki.models import Article
from wiki.models imp... | 4,480 | Python | .py | 109 | 32.669725 | 78 | 0.648281 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,249 | test_editor.py | django-wiki_django-wiki/tests/core/test_editor.py | import wiki.editors
from django.forms import Textarea
from wiki.editors.base import BaseEditor
from ..base import RequireRootArticleMixin
from ..base import WebTestBase
from ..base import wiki_override_settings
class CustomEditor(BaseEditor):
def get_widget(self, revision=None):
return Textarea(attrs={"d... | 2,908 | Python | .py | 69 | 33.26087 | 102 | 0.633888 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,250 | test_checks.py | django-wiki_django-wiki/tests/core/test_checks.py | import copy
from django.conf import settings
from django.core.checks import Error
from django.core.checks import registry
from django.test import TestCase
from wiki.checks import FIELDS_IN_CUSTOM_USER_MODEL
from wiki.checks import REQUIRED_CONTEXT_PROCESSORS
from wiki.checks import REQUIRED_INSTALLED_APPS
from wiki.ch... | 4,756 | Python | .py | 103 | 32.786408 | 155 | 0.579186 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,251 | test_links.py | django-wiki_django-wiki/tests/plugins/macros/test_links.py | from wiki.core import markdown
from tests.base import RequireRootArticleMixin
from tests.base import TestBase
class WikiLinksTests(RequireRootArticleMixin, TestBase):
def test_wikilink(self):
md = markdown.ArticleMarkdown(article=self.root_article)
md_text = md.convert("[[Root Article]]")
... | 468 | Python | .py | 11 | 35.818182 | 97 | 0.693833 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,252 | test_macro.py | django-wiki_django-wiki/tests/plugins/macros/test_macro.py | from wiki.core import markdown
from tests.base import RequireRootArticleMixin
from tests.base import TestBase
class MacroTests(RequireRootArticleMixin, TestBase):
def test_article_list(self):
md = markdown.ArticleMarkdown(article=self.root_article)
md_text = md.convert("[article_list depth:2]")
... | 707 | Python | .py | 14 | 44.071429 | 64 | 0.714078 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,253 | test_toc.py | django-wiki_django-wiki/tests/plugins/macros/test_toc.py | from django.test import TestCase
from markdown import Markdown
from wiki.core import markdown
from wiki.plugins.macros.mdx.toc import WikiTocExtension
from tests.base import RequireRootArticleMixin
from tests.base import TestBase
class TocMacroTests(TestCase):
maxDiff = None
def test_toc_renders_table_of_co... | 13,554 | Python | .py | 330 | 29.469697 | 91 | 0.508214 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,254 | test_forms.py | django-wiki_django-wiki/tests/plugins/images/test_forms.py | from django.test import TestCase
from django.utils.translation import gettext
from wiki.plugins.images.forms import PurgeForm
class PurgeFormTest(TestCase):
def test_not_sure(self):
form = PurgeForm(data={"confirm": False})
self.assertIs(form.is_valid(), False)
self.assertEqual(
... | 514 | Python | .py | 13 | 33.076923 | 73 | 0.676707 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,255 | test_markdown.py | django-wiki_django-wiki/tests/plugins/images/test_markdown.py | import base64
from io import BytesIO
from django.core.files.uploadedfile import InMemoryUploadedFile
from wiki.core import markdown
from wiki.plugins.images import models
from tests.base import RequireRootArticleMixin
from tests.base import TestBase
class ImageMarkdownTests(RequireRootArticleMixin, TestBase):
d... | 3,482 | Python | .py | 82 | 33.817073 | 91 | 0.626734 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,256 | test_views.py | django-wiki_django-wiki/tests/plugins/images/test_views.py | import base64
import os
import re
from io import BytesIO
from django.core.files.uploadedfile import InMemoryUploadedFile
from django.urls import reverse
from PIL import Image
from wiki.core.plugins import registry as plugin_registry
from wiki.models import URLPath
from wiki.plugins.images import models
from wiki.plugi... | 10,645 | Python | .py | 274 | 28.372263 | 81 | 0.574357 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,257 | test_editsection.py | django-wiki_django-wiki/tests/plugins/editsection/test_editsection.py | import re
from django.urls import reverse
from django_functest import FuncBaseMixin
from wiki.models import URLPath
from ...base import DjangoClientTestBase
from ...base import RequireRootArticleMixin
from ...base import WebTestBase
TEST_CONTENT = (
"Title 1\n"
"=======\n"
"## Title 2\n"
"Title 3\n"
... | 8,050 | Python | .py | 183 | 34.989071 | 166 | 0.603723 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,258 | test_redlinks.py | django-wiki_django-wiki/tests/plugins/redlinks/test_redlinks.py | from django.urls import reverse
from wiki.core import markdown
from wiki.models import URLPath
from ...base import wiki_override_settings
from tests.base import RequireRootArticleMixin
from tests.base import TestBase
class RedlinksTests(RequireRootArticleMixin, TestBase):
def setUp(self):
super().setUp()... | 3,518 | Python | .py | 76 | 38.697368 | 79 | 0.657995 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,259 | test_pymdown.py | django-wiki_django-wiki/tests/plugins/pymdown/test_pymdown.py | from django.test import TestCase
from markdown import Markdown
from wiki.core import markdown
from wiki.plugins.pymdown import wiki_plugin
from tests.base import RequireRootArticleMixin
from tests.base import TestBase
class TocMacroTests(TestCase):
"""
This is used to test the PyMdown extensions module indep... | 11,824 | Python | .py | 318 | 26.531447 | 98 | 0.542969 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,260 | test_globalhistory.py | django-wiki_django-wiki/tests/plugins/globalhistory/test_globalhistory.py | from django.urls import reverse
from django.utils import translation
from wiki.models import URLPath
from ...base import ArticleWebTestUtils
from ...base import DjangoClientTestBase
from ...base import RequireRootArticleMixin
class GlobalhistoryTests(
RequireRootArticleMixin, ArticleWebTestUtils, DjangoClientTes... | 3,496 | Python | .py | 84 | 31.488095 | 78 | 0.605829 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,261 | test_forms.py | django-wiki_django-wiki/tests/plugins/notifications/test_forms.py | from django.test import TestCase
from wiki.plugins.notifications.forms import SettingsFormSet
from tests.base import RequireSuperuserMixin
class SettingsFormTests(RequireSuperuserMixin, TestCase):
def test_formset(self):
SettingsFormSet(user=self.superuser1)
| 274 | Python | .py | 6 | 42.166667 | 60 | 0.845283 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,262 | test_views.py | django-wiki_django-wiki/tests/plugins/notifications/test_views.py | from django.shortcuts import resolve_url
from django_nyt.models import Settings
from tests.base import ArticleWebTestUtils
from tests.base import DjangoClientTestBase
from tests.base import RequireRootArticleMixin
class NotificationSettingsTests(
RequireRootArticleMixin, ArticleWebTestUtils, DjangoClientTestBase... | 2,628 | Python | .py | 59 | 35.050847 | 78 | 0.640282 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,263 | test_links.py | django-wiki_django-wiki/tests/plugins/links/test_links.py | import markdown
from ddt import data
from ddt import ddt
from ddt import unpack
from django.test import TestCase
from django.urls import reverse_lazy
from wiki.models import URLPath
from wiki.plugins.links.mdx.djangowikilinks import WikiPathExtension
from tests.base import wiki_override_settings
FIXTURE_POSITIVE_MATC... | 4,235 | Python | .py | 117 | 29.188034 | 113 | 0.611152 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,264 | test_urlize.py | django-wiki_django-wiki/tests/plugins/links/test_urlize.py | import html
import markdown
import pytest
from wiki.plugins.links.mdx.urlize import makeExtension
from wiki.plugins.links.mdx.urlize import UrlizeExtension
# Template accepts two strings - href value and link text value.
EXPECTED_LINK_TEMPLATE = (
'<a href="%s" rel="nofollow" target="_blank">'
'<span class="f... | 7,617 | Python | .py | 247 | 23.801619 | 91 | 0.544935 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,265 | test_commands.py | django-wiki_django-wiki/tests/plugins/attachments/test_commands.py | import os
import tempfile
from wiki.models import URLPath
from wiki.plugins.attachments import models
from tests.core.test_commands import TestManagementCommands
class TestAttachmentManagementCommands(TestManagementCommands):
"""
Add some more data
"""
def setUp(self):
super().setUp()
... | 942 | Python | .py | 28 | 26 | 78 | 0.661504 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,266 | test_views.py | django-wiki_django-wiki/tests/plugins/attachments/test_views.py | from io import BytesIO
from django.core.files.uploadedfile import InMemoryUploadedFile
from django.urls import reverse
from wiki.models import URLPath
from ...base import ArticleWebTestUtils
from ...base import DjangoClientTestBase
from ...base import RequireRootArticleMixin
class AttachmentTests(
RequireRootAr... | 6,852 | Python | .py | 163 | 32.472393 | 112 | 0.620183 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,267 | test_models.py | django-wiki_django-wiki/tests/plugins/attachments/test_models.py | from wiki.plugins.attachments.models import Attachment
from wiki.plugins.attachments.models import AttachmentRevision
from tests.base import RequireRootArticleMixin
from tests.base import TestBase
class AttachmentRevisionTests(RequireRootArticleMixin, TestBase):
def setUp(self):
super().setUp()
s... | 1,289 | Python | .py | 35 | 27.514286 | 77 | 0.630313 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,268 | manage.py | django-wiki_django-wiki/testproject/manage.py | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "testproject.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| 254 | Python | .py | 7 | 33.142857 | 75 | 0.741803 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,269 | urls.py | django-wiki_django-wiki/testproject/testproject/urls.py | from django.conf import settings
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.http.response import HttpResponse
from django.urls import include
from django.urls import re_path
from django.views.static import serve as static_serve
admin.autodiscover()
... | 1,226 | Python | .py | 37 | 27.72973 | 82 | 0.664975 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,270 | middleware.py | django-wiki_django-wiki/testproject/testproject/middleware.py | from django.contrib import messages
MSG = (
"This is a Django-Wiki demo, every 2 hours all data is removed from the server. "
"If you want to test something try login with admin:admin - "
"Please be respectful with the other visitors."
)
class DemoMiddleware:
def __init__(self, get_response):
... | 989 | Python | .py | 24 | 33.333333 | 85 | 0.655858 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,271 | wsgi.py | django-wiki_django-wiki/testproject/testproject/wsgi.py | """
WSGI config for testproject project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATIO... | 1,344 | Python | .py | 27 | 48.444444 | 79 | 0.81422 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,272 | views.py | django-wiki_django-wiki/testproject/testproject/views.py | from django.conf import settings
from django.shortcuts import render
from django.views.decorators.csrf import requires_csrf_token
@requires_csrf_token
def server_error(request, template_name="500.html", **param_dict):
return render(
request,
template_name,
context={
"MEDIA_URL"... | 669 | Python | .py | 19 | 28.947368 | 86 | 0.688854 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,273 | demo.py | django-wiki_django-wiki/testproject/testproject/settings/demo.py | from .base import * # noqa
DEBUG = False
ALLOWED_HOSTS = [".demo.django-wiki.org"]
SESSION_COOKIE_DOMAIN = ".demo.django-wiki.org"
SESSION_COOKIE_SECURE = True
MIDDLEWARE += ["testproject.middleware.DemoMiddleware"]
| 220 | Python | .py | 6 | 35.166667 | 55 | 0.763033 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,274 | local.py | django-wiki_django-wiki/testproject/testproject/settings/local.py | # Add your own changes here -- but do not push to remote!!
# After changing the file, from root of repository execute:
# git update-index --assume-unchanged testproject/testproject/settings/local.py
from .dev import * # noqa @UnusedWildImport
| 244 | Python | .py | 4 | 60 | 79 | 0.779167 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,275 | dev.py | django-wiki_django-wiki/testproject/testproject/settings/dev.py | from .base import * # noqa @UnusedWildImport
from .demo import * # noqa @UnusedWildImport
DEBUG = True
for template_engine in TEMPLATES:
template_engine["OPTIONS"]["debug"] = True
EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"
# Used by debug_toolbar
INTERNAL_IPS = ["127.0.0.1"]
ALLOWED_HOS... | 917 | Python | .py | 27 | 30.888889 | 97 | 0.725624 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,276 | codehilite.py | django-wiki_django-wiki/testproject/testproject/settings/codehilite.py | from testproject.settings import *
from testproject.settings.local import *
# Test codehilite with pygments
WIKI_MARKDOWN_KWARGS = {
"extensions": [
"codehilite",
"footnotes",
"attr_list",
"headerid",
"extra",
]
}
| 264 | Python | .py | 12 | 16.833333 | 40 | 0.628 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,277 | sendfile.py | django-wiki_django-wiki/testproject/testproject/settings/sendfile.py | from .base import * # noqa @UnusedWildImport
INSTALLED_APPS += ["sendfile"]
WIKI_ATTACHMENTS_USE_SENDFILE = True
SENDFILE_BACKEND = "sendfile.backends.development"
# SENDFILE_URL = None #Not needed
# SENDFILE_ROOT = None #Not needed
| 238 | Python | .py | 6 | 38 | 50 | 0.77193 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,278 | __init__.py | django-wiki_django-wiki/testproject/testproject/settings/__init__.py | try:
from .local import *
except ImportError:
from .base import *
| 74 | Python | .py | 4 | 15.5 | 24 | 0.7 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,279 | base.py | django-wiki_django-wiki/testproject/testproject/settings/base.py | import os
from django.urls import reverse_lazy
PROJECT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
BASE_DIR = os.path.dirname(PROJECT_DIR)
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/
# SECURITY WARNING: ... | 3,874 | Python | .py | 98 | 34.530612 | 73 | 0.719284 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,280 | customauthuser.py | django-wiki_django-wiki/testproject/testproject/settings/customauthuser.py | import os # noqa @UnusedImport
import sys
from .base import * # noqa @UnusedWildImport
from .dev import *
# Append testdata path
sys.path.append(os.path.join(os.path.dirname(os.path.dirname(PROJECT_DIR)), "tests"))
DATABASES = {
"default": {
# Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.... | 656 | Python | .py | 19 | 30.684211 | 85 | 0.697306 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,281 | _stacked.scss | django-wiki_django-wiki/src/wiki/static/wiki/font-awesome/scss/_stacked.scss | // Stacked Icons
// -------------------------
.#{$fa-css-prefix}-stack {
display: inline-block;
height: 2em;
line-height: 2em;
position: relative;
vertical-align: middle;
width: ($fa-fw-width*2);
}
.#{$fa-css-prefix}-stack-1x,
.#{$fa-css-prefix}-stack-2x {
left: 0;
position: absolute;
text-align: ce... | 505 | Python | .tac | 26 | 17.230769 | 29 | 0.620253 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,282 | build.py | simonwagner_mergepbx/build.py | #! /usr/bin/env python
#This script builds a standalone version of mergepbx.py
#all scripts are bundled into one single file that can be easily distributed
#the user will only need the file generated by this script and he can execute
#it like any other program
#idea: http://code.activestate.com/recipes/215301/
impor... | 4,344 | Python | .py | 116 | 31.525862 | 151 | 0.659752 | simonwagner/mergepbx | 1,037 | 46 | 14 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,283 | test_pbxmerge.py | simonwagner_mergepbx/test/test_pbxmerge.py | import sys
if sys.version_info >= (2,7):
import unittest
else:
import unittest2 as unittest
import os
try:
from cStringIO import StringIO
except:
from StringIO import StringIO
import difflib
from itertools import chain
import pbxproj
import pbxproj.merge.pbxmerge as pbxmerge
from pbxproj.merge import m... | 3,376 | Python | .py | 69 | 38.811594 | 116 | 0.638298 | simonwagner/mergepbx | 1,037 | 46 | 14 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,284 | test_pbxparsing.py | simonwagner_mergepbx/test/test_pbxparsing.py | import sys
import logging
import os
try:
from cStringIO import StringIO
except:
from StringIO import StringIO
if sys.version_info >= (2,7):
import unittest
else:
import unittest2 as unittest
import pbxproj
from testhelpers import fixture_path, make_logger, listpath, wrap_with_codec
from orderedset imp... | 1,857 | Python | .py | 41 | 37.097561 | 106 | 0.664266 | simonwagner/mergepbx | 1,037 | 46 | 14 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,285 | test_dictionaryboundobject.py | simonwagner_mergepbx/test/test_dictionaryboundobject.py | import sys
if sys.version_info >= (2,7):
import unittest
else:
import unittest2 as unittest
from pbxproj.core import DictionaryBoundObject
class DictionaryBoundObjectTest(unittest.TestCase):
def test_readValue(self):
data = {"a": "hello", "b" : "world"}
boundObj = DictionaryBoundObject(dat... | 665 | Python | .py | 18 | 30.777778 | 51 | 0.665109 | simonwagner/mergepbx | 1,037 | 46 | 14 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,286 | test_orderedset.py | simonwagner_mergepbx/test/test_orderedset.py | from orderedset import OrderedSet
import sys
if sys.version_info >= (2,7):
import unittest
else:
import unittest2 as unittest
class TokenStreamTest(unittest.TestCase):
def test_clear(self):
s = OrderedSet((1,2,3,4))
s.clear()
def test_weakref(self):
s = OrderedSet((1,2,3,4))
... | 438 | Python | .py | 16 | 22.3125 | 44 | 0.633094 | simonwagner/mergepbx | 1,037 | 46 | 14 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,287 | test_plist_nextstep.py | simonwagner_mergepbx/test/test_plist_nextstep.py | import sys
from StringIO import StringIO
if sys.version_info >= (2,7):
import unittest
else:
import unittest2 as unittest
import plist.nextstep
from plist.nextstep import NSPlistReader
class ParserTest(unittest.TestCase):
def test_simple_dict(self):
input = """{a = valuea; b = valueb;}"""
... | 957 | Python | .py | 25 | 32.04 | 64 | 0.630836 | simonwagner/mergepbx | 1,037 | 46 | 14 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,288 | testhelpers.py | simonwagner_mergepbx/test/testhelpers.py | import os
import logging
import codecs
TEST_DIR = os.path.dirname(__file__)
FIXTURES_DIR = os.path.join(TEST_DIR, "fixtures")
def fixture_path(path):
return os.path.join(FIXTURES_DIR, path)
def make_logger(clazz):
logger_name = "test.%s.%s" % (clazz.__module__, clazz.__name__)
return logging.getLogger(lo... | 639 | Python | .py | 17 | 33.882353 | 95 | 0.719156 | simonwagner/mergepbx | 1,037 | 46 | 14 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,289 | test_coremerge.py | simonwagner_mergepbx/test/test_coremerge.py | import sys
import logging
if sys.version_info >= (2,7):
import unittest
else:
import unittest2 as unittest
from pbxproj.merge.coremerge import *
from orderedset import OrderedSet
from collections import OrderedDict
class CoreMergeTest(unittest.TestCase):
def test_diff_dict_keys(self):
base = {
... | 8,478 | Python | .py | 266 | 21.612782 | 81 | 0.473135 | simonwagner/mergepbx | 1,037 | 46 | 14 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,290 | get_fixtures.py | simonwagner_mergepbx/tools/get_fixtures.py | #! /usr/bin/env python
import os
import sys
from collections import namedtuple
from git import Repo, GitCmdObjectDB
def main():
repo_path, file_path, destination = sys.argv[1:4]
collector = MergeCollector(repo_path)
for hashes, file_contents in collector.itermerges(file_path):
print "saving merg... | 2,275 | Python | .py | 48 | 39.041667 | 131 | 0.631222 | simonwagner/mergepbx | 1,037 | 46 | 14 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,291 | profile_merging.py | simonwagner_mergepbx/tools/profile_merging.py | #!/usr/bin/env python
import sys
from argparse import ArgumentParser
try:
import cProfile as profile
except:
import profile
from . import helpers
from . import TEST_DIR
helpers.setup_path()
import pbxproj
from pbxproj.merge import merge_pbxs
def get_argument_parser():
parser = ArgumentParser()
pars... | 1,331 | Python | .py | 37 | 27.837838 | 134 | 0.609984 | simonwagner/mergepbx | 1,037 | 46 | 14 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,292 | scan_isa.py | simonwagner_mergepbx/tools/scan_isa.py | #!/usr/bin/env python
import logging
import sys
import os
from . import helpers
helpers.setup_path()
from plist.nextstep import NSPlistReader, NSPlistWriter
from pbxproj.isa import ISA_MAPPING
fname = sys.argv[1]
f = open(fname)
r = NSPlistReader(f, name=fname)
project = r.read()
objects = project["objects"]
isas ... | 582 | Python | .py | 21 | 25.571429 | 70 | 0.754069 | simonwagner/mergepbx | 1,037 | 46 | 14 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,293 | test.py | simonwagner_mergepbx/tools/test.py | #!/usr/bin/env python
import sys
import os
import logging
from argparse import ArgumentParser
if sys.version_info >= (2,7):
import unittest
else:
import unittest2 as unittest
from . import helpers
from . import TEST_DIR
helpers.setup_path()
class OnlyTestLogsFilter(logging.Filter):
def filter(self, recor... | 2,415 | Python | .py | 70 | 26.928571 | 78 | 0.632031 | simonwagner/mergepbx | 1,037 | 46 | 14 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,294 | reloader.py | simonwagner_mergepbx/tools/reloader.py | # Python Module Reloader
#
# Copyright (c) 2009-2014 Jon Parise <jon@indelible.org>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rig... | 7,106 | Python | .py | 162 | 39.08642 | 85 | 0.706138 | simonwagner/mergepbx | 1,037 | 46 | 14 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,295 | nsplist.py | simonwagner_mergepbx/tools/nsplist.py | #!/usr/bin/env python
import logging
import sys
import os
from . import helpers
helpers.setup_path()
from plist.nextstep import NSPlistReader, NSPlistWriter
fname = sys.argv[1]
f = open(fname)
r = NSPlistReader(f, name=fname)
w = NSPlistWriter(sys.stdout)
w.write_plist(r.read())
| 285 | Python | .py | 12 | 22.333333 | 55 | 0.794776 | simonwagner/mergepbx | 1,037 | 46 | 14 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,296 | merge_pbxproj_fixtures.py | simonwagner_mergepbx/tools/merge_pbxproj_fixtures.py | #!/usr/bin/env python
import logging
import sys
import os
from StringIO import StringIO
import os.path
from . import helpers
helpers.setup_path()
from plist.nextstep import NSPlistReader
import pbxproj
from pbxproj.pbxobjects import PBXProjFile
from pbxproj.merge import get_project_file_merger
def main():
print... | 2,132 | Python | .py | 56 | 31.892857 | 141 | 0.654519 | simonwagner/mergepbx | 1,037 | 46 | 14 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,297 | benchmark.py | simonwagner_mergepbx/tools/benchmark.py | from argparse import ArgumentParser
import csv
import os
from subprocess import check_output
from tempfile import mkdtemp
import shutil
import time
import sys
import gc
import numpy as np
import scipy
from scipy.stats import t
try:
import cProfile as profile
except:
print "WARNING: could not load cProfile, resu... | 5,620 | Python | .py | 163 | 27.429448 | 87 | 0.628075 | simonwagner/mergepbx | 1,037 | 46 | 14 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,298 | profile_parsing.py | simonwagner_mergepbx/tools/profile_parsing.py | #!/usr/bin/env python
import sys
from argparse import ArgumentParser
try:
import cProfile as profile
except:
import profile
from . import helpers
from . import TEST_DIR
helpers.setup_path()
import pbxproj
def get_argument_parser():
parser = ArgumentParser()
parser.add_argument("file",
... | 1,048 | Python | .py | 34 | 22.676471 | 70 | 0.589232 | simonwagner/mergepbx | 1,037 | 46 | 14 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,299 | __init__.py | simonwagner_mergepbx/tools/__init__.py | import os
PROJECT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), "../"))
SRC_DIR = os.path.join(PROJECT_DIR, "src")
TEST_DIR = os.path.join(PROJECT_DIR, "test")
from . import helpers
| 200 | Python | .py | 5 | 38.6 | 77 | 0.699482 | simonwagner/mergepbx | 1,037 | 46 | 14 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |