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,100 | mbcsgroupprober.py | chardet_chardet/chardet/mbcsgroupprober.py | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | 2,131 | Python | .py | 54 | 35.740741 | 82 | 0.70974 | chardet/chardet | 2,153 | 257 | 66 | LGPL-2.1 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,101 | mbcharsetprober.py | chardet_chardet/chardet/mbcharsetprober.py | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | 3,715 | Python | .py | 83 | 36.771084 | 86 | 0.643646 | chardet/chardet | 2,153 | 257 | 66 | LGPL-2.1 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,102 | mbcssm.py | chardet_chardet/chardet/mbcssm.py | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | 30,391 | Python | .py | 615 | 45.131707 | 227 | 0.559233 | chardet/chardet | 2,153 | 257 | 66 | LGPL-2.1 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,103 | johabfreq.py | chardet_chardet/chardet/johabfreq.py | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | 42,498 | Python | .py | 2,380 | 12.905882 | 69 | 0.58109 | chardet/chardet | 2,153 | 257 | 66 | LGPL-2.1 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,104 | charsetgroupprober.py | chardet_chardet/chardet/charsetgroupprober.py | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | 3,915 | Python | .py | 97 | 31.762887 | 83 | 0.612759 | chardet/chardet | 2,153 | 257 | 66 | LGPL-2.1 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,105 | __init__.py | chardet_chardet/chardet/__init__.py | ######################## BEGIN LICENSE BLOCK ########################
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later ve... | 4,743 | Python | .py | 101 | 37.80198 | 88 | 0.626998 | chardet/chardet | 2,153 | 257 | 66 | LGPL-2.1 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,106 | euckrprober.py | chardet_chardet/chardet/euckrprober.py | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | 1,753 | Python | .py | 42 | 39 | 69 | 0.719812 | chardet/chardet | 2,153 | 257 | 66 | LGPL-2.1 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,107 | resultdict.py | chardet_chardet/chardet/resultdict.py | from typing import Optional, TypedDict
class ResultDict(TypedDict):
encoding: Optional[str]
confidence: float
language: Optional[str]
| 148 | Python | .py | 5 | 25.8 | 38 | 0.780142 | chardet/chardet | 2,153 | 257 | 66 | LGPL-2.1 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,108 | euckrfreq.py | chardet_chardet/chardet/euckrfreq.py | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | 13,566 | Python | .py | 191 | 69.691099 | 92 | 0.706657 | chardet/chardet | 2,153 | 257 | 66 | LGPL-2.1 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,109 | chardistribution.py | chardet_chardet/chardet/chardistribution.py | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | 10,382 | Python | .py | 228 | 38.109649 | 116 | 0.642723 | chardet/chardet | 2,153 | 257 | 66 | LGPL-2.1 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,110 | langhebrewmodel.py | chardet_chardet/chardet/langhebrewmodel.py | from chardet.sbcharsetprober import SingleByteCharSetModel
# 3: Positive
# 2: Likely
# 1: Unlikely
# 0: Negative
HEBREW_LANG_MODEL = {
50: { # 'a'
50: 0, # 'a'
60: 1, # 'c'
61: 1, # 'd'
42: 1, # 'e'
53: 1, # 'i'
56: 2, # 'l'
54: 2, # 'n'
49: ... | 98,184 | Python | .py | 4,375 | 12.9744 | 63 | 0.182989 | chardet/chardet | 2,153 | 257 | 66 | LGPL-2.1 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,111 | euctwprober.py | chardet_chardet/chardet/euctwprober.py | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | 1,753 | Python | .py | 42 | 39 | 69 | 0.719812 | chardet/chardet | 2,153 | 257 | 66 | LGPL-2.1 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,112 | langbulgarianmodel.py | chardet_chardet/chardet/langbulgarianmodel.py | from chardet.sbcharsetprober import SingleByteCharSetModel
# 3: Positive
# 2: Likely
# 1: Unlikely
# 0: Negative
BULGARIAN_LANG_MODEL = {
63: { # 'e'
63: 1, # 'e'
45: 0, # '\xad'
31: 0, # 'А'
32: 0, # 'Б'
35: 0, # 'В'
43: 0, # 'Г'
37: 0, # 'Д'
... | 104,550 | Python | .py | 4,642 | 13.187204 | 76 | 0.205838 | chardet/chardet | 2,153 | 257 | 66 | LGPL-2.1 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,113 | macromanprober.py | chardet_chardet/chardet/macromanprober.py | ######################## BEGIN LICENSE BLOCK ########################
# This code was modified from latin1prober.py by Rob Speer <rob@lumino.so>.
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by... | 6,077 | Python | .py | 144 | 37.354167 | 87 | 0.595266 | chardet/chardet | 2,153 | 257 | 66 | LGPL-2.1 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,114 | codingstatemachine.py | chardet_chardet/chardet/codingstatemachine.py | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | 3,732 | Python | .py | 77 | 42.363636 | 80 | 0.679846 | chardet/chardet | 2,153 | 257 | 66 | LGPL-2.1 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,115 | langrussianmodel.py | chardet_chardet/chardet/langrussianmodel.py | from chardet.sbcharsetprober import SingleByteCharSetModel
# 3: Positive
# 2: Likely
# 1: Unlikely
# 0: Negative
RUSSIAN_LANG_MODEL = {
37: { # 'А'
37: 0, # 'А'
44: 1, # 'Б'
33: 1, # 'В'
46: 1, # 'Г'
41: 1, # 'Д'
48: 1, # 'Е'
56: 1, # 'Ж'
51:... | 128,023 | Python | .py | 5,710 | 13.730123 | 82 | 0.231723 | chardet/chardet | 2,153 | 257 | 66 | LGPL-2.1 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,116 | big5freq.py | chardet_chardet/chardet/big5freq.py | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | 31,274 | Python | .py | 383 | 80.475196 | 87 | 0.739931 | chardet/chardet | 2,153 | 257 | 66 | LGPL-2.1 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,117 | langhungarianmodel.py | chardet_chardet/chardet/langhungarianmodel.py | from chardet.sbcharsetprober import SingleByteCharSetModel
# 3: Positive
# 2: Likely
# 1: Unlikely
# 0: Negative
HUNGARIAN_LANG_MODEL = {
28: { # 'A'
28: 0, # 'A'
40: 1, # 'B'
54: 1, # 'C'
45: 2, # 'D'
32: 1, # 'E'
50: 1, # 'F'
49: 2, # 'G'
3... | 101,351 | Python | .py | 4,642 | 13.151659 | 78 | 0.205702 | chardet/chardet | 2,153 | 257 | 66 | LGPL-2.1 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,118 | utf8prober.py | chardet_chardet/chardet/utf8prober.py | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | 2,812 | Python | .py | 70 | 33.914286 | 70 | 0.647253 | chardet/chardet | 2,153 | 257 | 66 | LGPL-2.1 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,119 | jpcntx.py | chardet_chardet/chardet/jpcntx.py | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | 27,155 | Python | .py | 217 | 118.124424 | 254 | 0.388453 | chardet/chardet | 2,153 | 257 | 66 | LGPL-2.1 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,120 | version.py | chardet_chardet/chardet/version.py | """
This module exists only to simplify retrieving the version number of chardet
from within setuptools and from chardet subpackages.
:author: Dan Blanchard (dan.blanchard@gmail.com)
"""
__version__ = "5.3.0dev0"
VERSION = __version__.split(".")
| 248 | Python | .py | 7 | 34.142857 | 76 | 0.757322 | chardet/chardet | 2,153 | 257 | 66 | LGPL-2.1 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,121 | codingstatemachinedict.py | chardet_chardet/chardet/codingstatemachinedict.py | from typing import Tuple, TypedDict
class CodingStateMachineDict(TypedDict, total=False):
class_table: Tuple[int, ...]
class_factor: int
state_table: Tuple[int, ...]
char_len_table: Tuple[int, ...]
name: str
language: str # Optional key
| 264 | Python | .py | 8 | 28.75 | 53 | 0.688976 | chardet/chardet | 2,153 | 257 | 66 | LGPL-2.1 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,122 | charsetprober.py | chardet_chardet/chardet/charsetprober.py | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | 5,419 | Python | .py | 123 | 36.333333 | 82 | 0.643846 | chardet/chardet | 2,153 | 257 | 66 | LGPL-2.1 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,123 | langturkishmodel.py | chardet_chardet/chardet/langturkishmodel.py | from chardet.sbcharsetprober import SingleByteCharSetModel
# 3: Positive
# 2: Likely
# 1: Unlikely
# 0: Negative
TURKISH_LANG_MODEL = {
23: { # 'A'
23: 0, # 'A'
37: 0, # 'B'
47: 0, # 'C'
39: 0, # 'D'
29: 0, # 'E'
52: 0, # 'F'
36: 0, # 'G'
45:... | 95,360 | Python | .py | 4,375 | 12.951771 | 80 | 0.195861 | chardet/chardet | 2,153 | 257 | 66 | LGPL-2.1 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,124 | escprober.py | chardet_chardet/chardet/escprober.py | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | 4,006 | Python | .py | 91 | 36.483516 | 82 | 0.657018 | chardet/chardet | 2,153 | 257 | 66 | LGPL-2.1 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,125 | big5prober.py | chardet_chardet/chardet/big5prober.py | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | 1,763 | Python | .py | 42 | 39.238095 | 69 | 0.721445 | chardet/chardet | 2,153 | 257 | 66 | LGPL-2.1 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,126 | latin1prober.py | chardet_chardet/chardet/latin1prober.py | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | 5,380 | Python | .py | 132 | 35.856061 | 85 | 0.577107 | chardet/chardet | 2,153 | 257 | 66 | LGPL-2.1 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,127 | languages.py | chardet_chardet/chardet/metadata/languages.py | """
Metadata about languages used by our model training code for our
SingleByteCharSetProbers. Could be used for other things in the future.
This code is based on the language metadata from the uchardet project.
"""
from string import ascii_letters
from typing import List, Optional
# TODO: Add Ukrainian (KOI8-U)
... | 13,560 | Python | .py | 342 | 28.318713 | 107 | 0.605463 | chardet/chardet | 2,153 | 257 | 66 | LGPL-2.1 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,128 | chardetect.py | chardet_chardet/chardet/cli/chardetect.py | """
Script which takes one or more file paths and reports on their detected
encodings
Example::
% chardetect somefile someotherfile
somefile: windows-1252 with confidence 0.5
someotherfile: ascii with confidence 1.0
If no paths are provided, it takes its input from stdin.
"""
import argparse
import sys... | 3,241 | Python | .py | 96 | 26.53125 | 98 | 0.621725 | chardet/chardet | 2,153 | 257 | 66 | LGPL-2.1 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,129 | forms_account_handling.py | django-wiki_django-wiki/src/wiki/forms_account_handling.py | import random
import string
import django.contrib.auth.models
from django import forms
from django.contrib.auth import get_user_model
from django.contrib.auth.forms import UserCreationForm
from django.core.exceptions import FieldDoesNotExist
from django.db.models.fields import CharField
from django.db.models.fields im... | 3,157 | Python | .py | 82 | 31.304878 | 123 | 0.674861 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,130 | checks.py | django-wiki_django-wiki/src/wiki/checks.py | from django.apps import apps
from django.core.checks import Error
from django.template import Engine
class Tags:
required_installed_apps = "required_installed_apps"
obsolete_installed_apps = "obsolete_installed_apps"
context_processors = "context_processors"
fields_in_custom_user_model = "fields_in_cu... | 4,399 | Python | .py | 111 | 29.828829 | 108 | 0.592601 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,131 | urls.py | django-wiki_django-wiki/src/wiki/urls.py | from django.urls import include
from django.urls import re_path
from django.utils.module_loading import import_string
from wiki import sites
from wiki.conf import settings
from wiki.core.plugins import registry
from wiki.views import accounts
from wiki.views import article
from wiki.views import deleted_list
urlpatter... | 12,282 | Python | .py | 332 | 23.963855 | 127 | 0.485161 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,132 | apps.py | django-wiki_django-wiki/src/wiki/apps.py | from django.apps import AppConfig
from django.core.checks import register
from django.utils.translation import gettext_lazy as _
from wiki.core.plugins.loader import load_wiki_plugins
from . import checks
class WikiConfig(AppConfig):
default_site = "wiki.sites.WikiSite"
name = "wiki"
verbose_name = _("Wi... | 884 | Python | .py | 26 | 26.230769 | 79 | 0.660422 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,133 | sites.py | django-wiki_django-wiki/src/wiki/sites.py | from django.apps import apps
from django.urls import include
from django.urls import re_path
from django.utils.functional import LazyObject
from django.utils.module_loading import import_string
from wiki.conf import settings
from wiki.core.plugins import registry
class WikiSite:
"""
Wiki site configurator.
... | 11,493 | Python | .py | 304 | 25.358553 | 79 | 0.501299 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,134 | __init__.py | django-wiki_django-wiki/src/wiki/__init__.py | # This package and all its sub-packages are part of django-wiki,
# except where otherwise stated.
#
# django-wiki is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your ... | 774 | Python | .py | 16 | 47.3125 | 70 | 0.783355 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,135 | admin.py | django-wiki_django-wiki/src/wiki/admin.py | from django import forms
from django.contrib import admin
from django.contrib.contenttypes.admin import GenericTabularInline
from django.utils.translation import gettext_lazy as _
from mptt.admin import MPTTModelAdmin
from . import editors
from . import models
class ArticleObjectAdmin(GenericTabularInline):
mode... | 3,096 | Python | .py | 83 | 30.566265 | 79 | 0.671462 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,136 | decorators.py | django-wiki_django-wiki/src/wiki/decorators.py | from functools import wraps
from urllib.parse import quote as urlquote
from django.http import Http404
from django.http import HttpResponseForbidden
from django.http import HttpResponseNotFound
from django.http import HttpResponseRedirect
from django.shortcuts import redirect
from django.template.loader import render_... | 6,904 | Python | .py | 170 | 30.117647 | 106 | 0.610597 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,137 | forms.py | django-wiki_django-wiki/src/wiki/forms.py | __all__ = [
"UserCreationForm",
"UserUpdateForm",
"WikiSlugField",
"SpamProtectionMixin",
"CreateRootForm",
"MoveForm",
"EditForm",
"SelectWidgetBootstrap",
"TextInputPrepend",
"CreateForm",
"DeleteForm",
"PermissionsForm",
"DirFilterForm",
"SearchForm",
]
from d... | 22,515 | Python | .py | 565 | 29.40354 | 213 | 0.590075 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,138 | managers.py | django-wiki_django-wiki/src/wiki/managers.py | from django.db import models
from django.db.models import Count
from django.db.models import Q
from django.db.models.query import EmptyQuerySet
from django.db.models.query import QuerySet
from mptt.managers import TreeManager
class ArticleQuerySet(QuerySet):
def can_read(self, user):
"""Filter objects so ... | 5,264 | Python | .py | 139 | 29.23741 | 79 | 0.630315 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,139 | pluginbase.py | django-wiki_django-wiki/src/wiki/models/pluginbase.py | """
There are three kinds of plugin base models:
1) SimplePlugin - an object purely associated with an article. Will bump the
article's revision history upon creation, and rolling back an article will
make it go away (not from the database, you can roll forwards again).
2) RevisionPlugin - an object wit... | 11,400 | Python | .py | 267 | 36.097378 | 85 | 0.694944 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,140 | __init__.py | django-wiki_django-wiki/src/wiki/models/__init__.py | from django import shortcuts
from django import urls
from django.urls import base
from django.utils.functional import lazy
from .article import * # noqa
from .pluginbase import * # noqa
from .urlpath import * # noqa
original_django_reverse = urls.reverse
def reverse(*args, **kwargs):
"""Now this is a crazy a... | 1,599 | Python | .py | 38 | 36.894737 | 73 | 0.70129 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,141 | article.py | django-wiki_django-wiki/src/wiki/models/article.py | from django.conf import settings as django_settings
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.core.cache import cache
from django.db import models
from django.db.models.fields import GenericIPAddressField as IPAddressField
fro... | 17,835 | Python | .py | 425 | 33.677647 | 158 | 0.646926 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,142 | urlpath.py | django-wiki_django-wiki/src/wiki/models/urlpath.py | import logging
import warnings
from django.contrib.contenttypes.fields import GenericRelation
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site
from django.core.exceptions import ValidationError
from django.db import models
from django.db import transaction
from dj... | 15,032 | Python | .py | 400 | 28.07 | 132 | 0.598641 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,143 | wiki_tags.py | django-wiki_django-wiki/src/wiki/templatetags/wiki_tags.py | import re
from urllib.parse import quote as urlquote
from django import template
from django.apps import apps
from django.conf import settings as django_settings
from django.contrib.contenttypes.models import ContentType
from django.db.models import Model
from django.forms import BaseForm
from django.template.defaultf... | 6,108 | Python | .py | 169 | 30.094675 | 80 | 0.670229 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,144 | 0003_mptt_upgrade.py | django-wiki_django-wiki/src/wiki/migrations/0003_mptt_upgrade.py | # Upgrades fields changed in django-mptt
# See: https://github.com/django-mptt/django-mptt/pull/578
# Generated by Django 2.2.7 on 2020-02-06 20:36
import django.db.models.deletion
from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
dependencies = [
("wiki... | 1,321 | Python | .py | 38 | 25.342105 | 62 | 0.602815 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,145 | 0002_urlpath_moved_to.py | django-wiki_django-wiki/src/wiki/migrations/0002_urlpath_moved_to.py | # Generated by Django 1.10.7 on 2017-06-06 23:18
import django.db.models.deletion
import mptt.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("wiki", "0001_initial"),
]
operations = [
migrations.AddField(
model_name="urlpath",
... | 732 | Python | .py | 23 | 21.956522 | 68 | 0.563121 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,146 | 0001_initial.py | django-wiki_django-wiki/src/wiki/migrations/0001_initial.py | import django.db.models.deletion
import mptt.fields
from django.conf import settings
from django.db import migrations
from django.db import models
from django.db.models.fields import GenericIPAddressField as IPAddressField
from wiki.conf.settings import GROUP_MODEL
class Migration(migrations.Migration):
dependen... | 16,976 | Python | .py | 451 | 19.86918 | 173 | 0.420374 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,147 | mixins.py | django-wiki_django-wiki/src/wiki/views/mixins.py | import logging
from django.views.generic.base import TemplateResponseMixin
from wiki.conf import settings
from wiki.core.plugins import registry
log = logging.getLogger(__name__)
class ArticleMixin(TemplateResponseMixin):
"""A mixin that receives an article object as a parameter (usually from a wiki
decora... | 1,682 | Python | .py | 38 | 33.605263 | 95 | 0.612706 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,148 | accounts.py | django-wiki_django-wiki/src/wiki/views/accounts.py | """Here is a very basic handling of accounts.
If you have your own account handling, don't worry,
just switch off account handling in
settings.WIKI_ACCOUNT_HANDLING = False
and remember to set
settings.WIKI_SIGNUP_URL = '/your/signup/url'
SETTINGS.LOGIN_URL
SETTINGS.LOGOUT_URL
"""
from django.conf import settings as d... | 5,491 | Python | .py | 130 | 34.761538 | 76 | 0.66373 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,149 | deleted_list.py | django-wiki_django-wiki/src/wiki/views/deleted_list.py | from django.shortcuts import redirect
from django.views.generic.base import TemplateView
from wiki import models
class DeletedListView(TemplateView):
template_name = "wiki/deleted_list.html"
def dispatch(self, request, *args, **kwargs):
# Let logged in super users continue
if not request.user... | 799 | Python | .py | 18 | 36.666667 | 57 | 0.684278 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,150 | article.py | django-wiki_django-wiki/src/wiki/views/article.py | import difflib
import logging
from urllib.parse import urljoin
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.db import transaction
from django.db.models import Q
from django.http import Http404
from django.shortcuts import get_object_or_404
from django.shortc... | 39,507 | Python | .py | 909 | 31.627063 | 134 | 0.581376 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,151 | markitup.py | django-wiki_django-wiki/src/wiki/editors/markitup.py | from django import forms
from wiki.editors.base import BaseEditor
class MarkItUpWidget(forms.Widget):
template_name = "wiki/forms/markitup.html"
def __init__(self, attrs=None):
# The 'rows' and 'cols' attributes are required for HTML correctness.
default_attrs = {
"class": "markIt... | 1,579 | Python | .py | 47 | 24.085106 | 77 | 0.570395 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,152 | __init__.py | django-wiki_django-wiki/src/wiki/editors/__init__.py | from django.urls import get_callable
from wiki.conf import settings
_EditorClass = None
_editor = None
def getEditorClass():
global _EditorClass
if not _EditorClass:
_EditorClass = get_callable(settings.EDITOR)
return _EditorClass
def getEditor():
global _editor
if not _editor:
... | 368 | Python | .py | 14 | 22.071429 | 52 | 0.722063 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,153 | base.py | django-wiki_django-wiki/src/wiki/editors/base.py | from django import forms
class BaseEditor:
"""Editors should inherit from this. See wiki.editors for examples."""
# The editor id can be used for conditional testing. If you write your
# own editor class, you can use the same editor_id as some editor
editor_id = "plaintext"
media_admin = ()
... | 601 | Python | .py | 18 | 27.055556 | 74 | 0.64 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,154 | paginator.py | django-wiki_django-wiki/src/wiki/core/paginator.py | from django.core.paginator import Paginator
class WikiPaginator(Paginator):
def __init__(self, *args, **kwargs):
"""
:param side_pages: How many pages should be shown before and after the current page
"""
self.side_pages = kwargs.pop("side_pages", 4)
super().__init__(*args,... | 1,068 | Python | .py | 30 | 26.733333 | 91 | 0.569632 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,155 | utils.py | django-wiki_django-wiki/src/wiki/core/utils.py | from django.http.response import JsonResponse
def object_to_json_response(obj, status=200):
"""
Given an object, returns an HttpResponse object with a JSON serialized
version of that object
"""
return JsonResponse(
data=obj,
status=status,
safe=False,
json_dumps_par... | 355 | Python | .py | 12 | 23.75 | 74 | 0.674487 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,156 | exceptions.py | django-wiki_django-wiki/src/wiki/core/exceptions.py | # If no root URL is found, we raise this...
class NoRootURL(Exception):
pass
# If there is more than one...
class MultipleRootURLs(Exception):
pass
| 162 | Python | .py | 6 | 23.666667 | 43 | 0.733333 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,157 | diff.py | django-wiki_django-wiki/src/wiki/core/diff.py | import difflib
def simple_merge(txt1, txt2):
"""Merges two texts"""
differ = difflib.Differ(charjunk=difflib.IS_CHARACTER_JUNK)
diff = differ.compare(txt1.splitlines(1), txt2.splitlines(1))
content = "".join([_l[2:] for _l in diff])
return content
| 272 | Python | .py | 7 | 34.428571 | 65 | 0.693487 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,158 | permissions.py | django-wiki_django-wiki/src/wiki/core/permissions.py | from wiki.conf import settings
###############################
# ARTICLE PERMISSION HANDLING #
###############################
#
# All functions are:
# can_something(article, user)
# => True/False
#
# All functions can be replaced by pointing their relevant
# settings variable in wiki.conf.settings to a callabl... | 3,128 | Python | .py | 87 | 28.724138 | 78 | 0.650347 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,159 | http.py | django-wiki_django-wiki/src/wiki/core/http.py | import mimetypes
import os
from datetime import datetime
from django.http import HttpResponse
from django.utils import dateformat
from django.utils.encoding import filepath_to_uri
from django.utils.http import http_date
from wiki.conf import settings
def django_sendfile_response(request, filepath):
from sendfile... | 1,759 | Python | .py | 46 | 31.217391 | 74 | 0.684118 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,160 | __init__.py | django-wiki_django-wiki/src/wiki/core/markdown/__init__.py | import bleach
import markdown
from bleach.css_sanitizer import CSSSanitizer
from wiki.conf import settings
from wiki.core.plugins import registry as plugin_registry
class ArticleMarkdown(markdown.Markdown):
def __init__(self, article, preview=False, user=None, *args, **kwargs):
kwargs.update(settings.MARK... | 4,209 | Python | .py | 101 | 32.277228 | 94 | 0.614858 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,161 | responsivetable.py | django-wiki_django-wiki/src/wiki/core/markdown/mdx/responsivetable.py | from xml.etree import ElementTree as etree
import markdown
from markdown.treeprocessors import Treeprocessor
from wiki.core.markdown import add_to_registry
class ResponsiveTableExtension(markdown.Extension):
"""Wraps all tables with Bootstrap's table-responsive class"""
def extendMarkdown(self, md):
... | 1,845 | Python | .py | 45 | 33.244444 | 78 | 0.670022 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,162 | previewlinks.py | django-wiki_django-wiki/src/wiki/core/markdown/mdx/previewlinks.py | import markdown
from markdown.treeprocessors import Treeprocessor
from wiki.core.markdown import add_to_registry
class PreviewLinksExtension(markdown.Extension):
"""Markdown Extension that sets all anchor targets to _blank when in preview mode"""
def extendMarkdown(self, md):
add_to_registry(
... | 860 | Python | .py | 20 | 35.2 | 88 | 0.66226 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,163 | base.py | django-wiki_django-wiki/src/wiki/core/plugins/base.py | from django import forms
from django.utils.translation import gettext as _
"""Base classes for different plugin objects.
* BasePlugin: Create a wiki_plugin.py with a class that inherits from BasePlugin.
* PluginSidebarFormMixin: Mix in this class in the form that should be rendered in the editor sidebar
* PluginS... | 2,052 | Python | .py | 53 | 33.415094 | 102 | 0.664985 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,164 | registry.py | django-wiki_django-wiki/src/wiki/core/plugins/registry.py | from importlib import import_module
_cache = {}
_settings_forms = []
_markdown_extensions = []
_article_tabs = []
_sidebar = []
_html_whitelist = []
_html_attributes = {}
def register(PluginClass):
"""
Register a plugin class. This function will call back your plugin's
constructor.
"""
if PluginC... | 2,027 | Python | .py | 54 | 32.259259 | 73 | 0.690256 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,165 | settings.py | django-wiki_django-wiki/src/wiki/plugins/macros/settings.py | from django.conf import settings as django_settings
SLUG = "macros"
APP_LABEL = "wiki"
#: List of markdown extensions this plugin should support.
#: ``article_list`` inserts a list of articles from the current level.
#: ``toc`` inserts a table of contents matching the headings.
METHODS = getattr(
django_settings,... | 403 | Python | .py | 14 | 25.357143 | 70 | 0.697674 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,166 | apps.py | django-wiki_django-wiki/src/wiki/plugins/macros/apps.py | from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class MacrosConfig(AppConfig):
name = "wiki.plugins.macros"
verbose_name = _("Wiki macros")
label = "wiki_macros"
| 217 | Python | .py | 6 | 32.833333 | 54 | 0.751196 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,167 | wiki_plugin.py | django-wiki_django-wiki/src/wiki/plugins/macros/wiki_plugin.py | from django.utils.translation import gettext as _
from wiki.core.plugins import registry
from wiki.core.plugins.base import BasePlugin
from wiki.plugins.macros import settings
class MacroPlugin(BasePlugin):
slug = settings.SLUG
sidebar = {
"headline": _("Macros"),
"icon_class": "fa-play",
... | 643 | Python | .py | 19 | 28.105263 | 55 | 0.674757 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,168 | macro.py | django-wiki_django-wiki/src/wiki/plugins/macros/mdx/macro.py | import re
import markdown
from django.template.loader import render_to_string
from django.utils.translation import gettext as _
from wiki.core.markdown import add_to_registry
from wiki.plugins.macros import settings
from wiki.plugins.macros.mdx import toc
# See:
# http://stackoverflow.com/questions/430759/regex-for-m... | 5,202 | Python | .py | 122 | 32.467213 | 138 | 0.556392 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,169 | toc.py | django-wiki_django-wiki/src/wiki/plugins/macros/mdx/toc.py | from markdown.extensions.toc import slugify
from markdown.extensions.toc import TocExtension
from markdown.extensions.toc import TocTreeprocessor
from wiki.plugins.macros import settings
HEADER_ID_PREFIX = "wiki-toc-"
def process_toc_depth(toc_depth):
if isinstance(toc_depth, str) and "-" in toc_depth:
t... | 4,527 | Python | .py | 110 | 30.027273 | 118 | 0.581115 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,170 | wikilinks.py | django-wiki_django-wiki/src/wiki/plugins/macros/mdx/wikilinks.py | """
Extend the shipped Markdown extension 'wikilinks'
"""
import re
import xml.etree.ElementTree
from django.urls import reverse
from markdown.extensions import Extension
from markdown.extensions import wikilinks
from wiki.core.markdown import add_to_registry
def build_url(label, base, end, md):
"""Build a url f... | 2,266 | Python | .py | 55 | 34.236364 | 79 | 0.619827 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,171 | wiki_macro_tags.py | django-wiki_django-wiki/src/wiki/plugins/macros/templatetags/wiki_macro_tags.py | from django import template
from wiki.plugins.macros import settings
from wiki.plugins.macros.mdx.macro import MacroPattern
register = template.Library()
@register.inclusion_tag(
"wiki/plugins/templatetags/article_list.html", takes_context=True
)
def article_list(context, urlpath, depth):
context["parent"] =... | 576 | Python | .py | 18 | 27.388889 | 69 | 0.74141 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,172 | apps.py | django-wiki_django-wiki/src/wiki/plugins/help/apps.py | from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class HelpConfig(AppConfig):
name = "wiki.plugins.help"
verbose_name = _("Wiki help")
label = "wiki_help"
| 209 | Python | .py | 6 | 31.5 | 54 | 0.741294 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,173 | wiki_plugin.py | django-wiki_django-wiki/src/wiki/plugins/help/wiki_plugin.py | from django.utils.translation import gettext as _
from wiki.core.plugins import registry
from wiki.core.plugins.base import BasePlugin
class HelpPlugin(BasePlugin):
slug = "help"
sidebar = {
"headline": _("Help"),
"icon_class": "fa-question-circle",
"template": "wiki/plugins/help/side... | 470 | Python | .py | 14 | 28.142857 | 53 | 0.668889 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,174 | models.py | django-wiki_django-wiki/src/wiki/plugins/images/models.py | import os.path
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.models.pluginbase import RevisionPlugin
from wiki.models.pluginbase import R... | 5,183 | Python | .py | 135 | 29.948148 | 85 | 0.637976 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,175 | checks.py | django-wiki_django-wiki/src/wiki/plugins/images/checks.py | from django.apps import apps
from django.core.checks import Error
class Tags:
required_installed_apps = "required_installed_apps"
def check_for_required_installed_apps(app_configs, **kwargs):
errors = []
if not apps.is_installed("sorl.thumbnail"):
errors.append(
Error(
... | 428 | Python | .py | 13 | 26.076923 | 79 | 0.659367 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,176 | settings.py | django-wiki_django-wiki/src/wiki/plugins/images/settings.py | from django.conf import settings as django_settings
from wiki.conf import settings as wiki_settings
SLUG = "images"
# Deprecated
APP_LABEL = None
#: Location where uploaded images are stored. ``%aid`` is replaced by the article id.
IMAGE_PATH = getattr(django_settings, "WIKI_IMAGES_PATH", "wiki/images/%aid/")
#: Si... | 1,699 | Python | .py | 42 | 37.47619 | 85 | 0.726061 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,177 | markdown_extensions.py | django-wiki_django-wiki/src/wiki/plugins/images/markdown_extensions.py | import re
import markdown
from django.template.loader import render_to_string
from wiki.core.markdown import add_to_registry
from wiki.plugins.images import models
from wiki.plugins.images import settings
IMAGE_RE = (
r"(?:"
+
# Match '[image:N'
r"\[image\:(?P<id>[0-9]+)"
+
# Match optional 'a... | 3,775 | Python | .py | 101 | 29.069307 | 79 | 0.596827 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,178 | apps.py | django-wiki_django-wiki/src/wiki/plugins/images/apps.py | from django.apps import AppConfig
from django.core.checks import register
from django.utils.translation import gettext_lazy as _
from . import checks
class ImagesConfig(AppConfig):
name = "wiki.plugins.images"
verbose_name = _("Wiki images")
label = "wiki_images"
def ready(self):
register(
... | 432 | Python | .py | 13 | 27.615385 | 54 | 0.706024 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,179 | wiki_plugin.py | django-wiki_django-wiki/src/wiki/plugins/images/wiki_plugin.py | 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.images import forms
from wiki.plugins.images import models
from wiki.plugins.images import settings
from wiki.plugins.images import vie... | 2,769 | Python | .py | 73 | 27.931507 | 77 | 0.56978 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,180 | admin.py | django-wiki_django-wiki/src/wiki/plugins/images/admin.py | from django import forms
from django.contrib import admin
from . import models
class ImageForm(forms.ModelForm):
class Meta:
model = models.Image
exclude = ()
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
if self.instance.pk:
revisions = m... | 965 | Python | .py | 27 | 28 | 72 | 0.645474 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,181 | forms.py | django-wiki_django-wiki/src/wiki/plugins/images/forms.py | from django import forms
from django.utils.translation import gettext
from django.utils.translation import gettext_lazy as _
from wiki.core.plugins.base import PluginSidebarFormMixin
from wiki.plugins.images import models
class SidebarForm(PluginSidebarFormMixin):
def __init__(self, article, request, *args, **kwa... | 2,375 | Python | .py | 57 | 32.807018 | 123 | 0.627927 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,182 | views.py | django-wiki_django-wiki/src/wiki/plugins/images/views.py | import logging
from django.contrib import messages
from django.shortcuts import get_object_or_404
from django.shortcuts import redirect
from django.urls import reverse
from django.utils.decorators import method_decorator
from django.utils.translation import gettext as _
from django.views.generic import FormView
from d... | 7,806 | Python | .py | 183 | 33.568306 | 83 | 0.639236 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,183 | wiki_images_tags.py | django-wiki_django-wiki/src/wiki/plugins/images/templatetags/wiki_images_tags.py | from django import template
from wiki.plugins.images import models
from wiki.plugins.images import settings
register = template.Library()
@register.filter
def images_for_article(article):
return models.Image.objects.filter(
article=article, current_revision__deleted=False
).order_by("-current_revisio... | 510 | Python | .py | 14 | 32.785714 | 66 | 0.773931 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,184 | 0002_auto_20151118_1811.py | django-wiki_django-wiki/src/wiki/plugins/images/migrations/0002_auto_20151118_1811.py | from django.db import migrations
class Migration(migrations.Migration):
atomic = False
dependencies = [
("wiki_images", "0001_initial"),
]
operations = [
migrations.AlterModelTable(
name="image",
table="wiki_images_image",
),
migrations.AlterM... | 429 | Python | .py | 16 | 18.75 | 46 | 0.585784 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,185 | 0001_initial.py | django-wiki_django-wiki/src/wiki/plugins/images/migrations/0001_initial.py | import wiki.plugins.images.models
from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
dependencies = [
("wiki", "0001_initial"),
]
operations = [
migrations.CreateModel(
name="Image",
fields=[
(
... | 2,253 | Python | .py | 65 | 17.907692 | 76 | 0.415293 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,186 | settings.py | django-wiki_django-wiki/src/wiki/plugins/editsection/settings.py | from django.conf import settings as django_settings
from django.utils.translation import gettext
SLUG = "editsection"
#: Add "[edit]" links to all section headers till this level. By using
#: these links editing only the text from the selected section is possible.
MAX_LEVEL = getattr(django_settings, "WIKI_EDITSECTIO... | 583 | Python | .py | 11 | 51.363636 | 78 | 0.782074 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,187 | markdown_extensions.py | django-wiki_django-wiki/src/wiki/plugins/editsection/markdown_extensions.py | import logging
import re
from xml.etree import ElementTree as etree
from django.urls import reverse
from markdown import Extension
from markdown.blockprocessors import HashHeaderProcessor
from markdown.blockprocessors import SetextHeaderProcessor
from markdown.treeprocessors import Treeprocessor
from wiki.core.markdow... | 6,370 | Python | .py | 155 | 30.23871 | 94 | 0.577128 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,188 | apps.py | django-wiki_django-wiki/src/wiki/plugins/editsection/apps.py | from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class EditSectionConfig(AppConfig):
name = "wiki.plugins.editsection"
verbose_name = _("Wiki edit section")
label = "wiki_editsection"
| 238 | Python | .py | 6 | 36.333333 | 54 | 0.769565 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,189 | wiki_plugin.py | django-wiki_django-wiki/src/wiki/plugins/editsection/wiki_plugin.py | from django.urls import re_path as url
from wiki.core.plugins import registry
from wiki.core.plugins.base import BasePlugin
from wiki.plugins.editsection.markdown_extensions import EditSectionExtension
from . import settings
from . import views
class EditSectionPlugin(BasePlugin):
slug = settings.SLUG
urlpat... | 619 | Python | .py | 19 | 25.789474 | 77 | 0.670034 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,190 | views.py | django-wiki_django-wiki/src/wiki/plugins/editsection/views.py | from django.contrib import messages
from django.shortcuts import get_object_or_404
from django.shortcuts import redirect
from django.utils.decorators import method_decorator
from django.utils.translation import gettext_lazy
from wiki import models
from wiki.core.markdown import article_markdown
from wiki.decorators imp... | 5,243 | Python | .py | 122 | 31.737705 | 80 | 0.593187 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,191 | apps.py | django-wiki_django-wiki/src/wiki/plugins/redlinks/apps.py | from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class RedlinksConfig(AppConfig):
name = "wiki.plugins.redlinks"
verbose_name = _("Wiki red links")
label = "wiki_redlinks"
| 226 | Python | .py | 6 | 34.333333 | 54 | 0.756881 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,192 | wiki_plugin.py | django-wiki_django-wiki/src/wiki/plugins/redlinks/wiki_plugin.py | from wiki.core.plugins import registry
from wiki.core.plugins.base import BasePlugin
class Plugin(BasePlugin):
markdown_extensions = [
"wiki.plugins.redlinks.mdx.redlinks",
]
registry.register(Plugin)
| 221 | Python | .py | 7 | 27.714286 | 45 | 0.77619 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,193 | redlinks.py | django-wiki_django-wiki/src/wiki/plugins/redlinks/mdx/redlinks.py | import html
from urllib.parse import urljoin
from urllib.parse import urlparse
import wiki
from django.urls import resolve
from django.urls.exceptions import Resolver404
from markdown.extensions import Extension
from markdown.postprocessors import AndSubstitutePostprocessor
from markdown.treeprocessors import Treeproc... | 3,628 | Python | .py | 99 | 27.242424 | 78 | 0.600626 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,194 | settings.py | django-wiki_django-wiki/src/wiki/plugins/pymdown/settings.py | from django.utils.translation import gettext as _
from django.conf import settings as django_settings
from wiki.conf import settings
SLUG = "pymdown"
APP_LABEL = "wiki"
def update_whitelist():
setattr(
settings,
"MARKDOWN_HTML_WHITELIST",
getattr(settings, "MARKDOWN_HTML_WHITELIST", froze... | 3,831 | Python | .py | 102 | 29.607843 | 254 | 0.592722 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,195 | apps.py | django-wiki_django-wiki/src/wiki/plugins/pymdown/apps.py | from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class PyMdownConfig(AppConfig):
name = "wiki.plugins.pymdown"
verbose_name = _("PyMDown Extension")
label = "wiki_pymdown"
| 226 | Python | .py | 6 | 34.333333 | 54 | 0.761468 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,196 | wiki_plugin.py | django-wiki_django-wiki/src/wiki/plugins/pymdown/wiki_plugin.py | from django.utils.translation import gettext as _
from wiki.core.plugins import registry
from wiki.core.plugins.base import BasePlugin
from wiki.plugins.pymdown import settings
class PymdownPlugin(BasePlugin):
slug = settings.SLUG
sidebar = {
"headline": _("PyMdown Macros"),
"icon_class": "fa... | 752 | Python | .py | 22 | 28.5 | 56 | 0.68603 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,197 | wiki_pymdown_tags.py | django-wiki_django-wiki/src/wiki/plugins/pymdown/templatetags/wiki_pymdown_tags.py | from django import template
from wiki.plugins.pymdown import settings
register = template.Library()
@register.simple_tag
def allowed_pymdown_macros():
yield from settings.pymdown_docs
| 191 | Python | .py | 6 | 29.666667 | 41 | 0.82967 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,198 | apps.py | django-wiki_django-wiki/src/wiki/plugins/globalhistory/apps.py | from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class GlobalHistoryConfig(AppConfig):
name = "wiki.plugins.globalhistory"
verbose_name = _("Wiki Global History")
label = "wiki_globalhistory"
| 246 | Python | .py | 6 | 37.666667 | 54 | 0.777311 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |
20,199 | wiki_plugin.py | django-wiki_django-wiki/src/wiki/plugins/globalhistory/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 GlobalHistoryPlugin(BasePlugin):
slug = settings.SLUG
urlpatterns = {
"root": [
re_path(
r"^$", views.Globa... | 596 | Python | .py | 20 | 21.55 | 74 | 0.590193 | django-wiki/django-wiki | 1,819 | 569 | 48 | GPL-3.0 | 9/5/2024, 5:12:30 PM (Europe/Amsterdam) |