Fix some of the headers in trilby.

Standard comment block at the start, and getting the logger in the same way.
status-serialisers
Marnanel Thurman 2020-08-23 16:53:25 +01:00
rodzic a4fa15e825
commit b42887616e
12 zmienionych plików z 97 dodań i 18 usunięć

Wyświetl plik

@ -1,3 +1,12 @@
# crypto.py
#
# Part of kepi.
# Copyright (c) 2018-2020 Marnanel Thurman.
# Licensed under the GNU Public License v2.
import logging
logger = logging.getLogger(name='kepi')
from Crypto.PublicKey import RSA
from Crypto.Hash import SHA256
from struct import pack

Wyświetl plik

@ -1,3 +1,12 @@
# follow.py
#
# Part of kepi.
# Copyright (c) 2018-2020 Marnanel Thurman.
# Licensed under the GNU Public License v2.
import logging
logger = logging.getLogger(name='kepi')
from django.db import models
from django.db.models.constraints import UniqueConstraint
from django.contrib.auth.models import AbstractUser
@ -6,9 +15,6 @@ import kepi.bowler_pub.crypto as crypto
from kepi.bowler_pub.utils import uri_to_url
from django.utils.timezone import now
from django.core.exceptions import ValidationError
import logging
logger = logging.Logger('kepi')
class Follow(models.Model):

Wyświetl plik

@ -1,3 +1,12 @@
# follow.py
#
# Part of kepi.
# Copyright (c) 2018-2020 Marnanel Thurman.
# Licensed under the GNU Public License v2.
import logging
logger = logging.getLogger(name='kepi')
from django.db import models
from django.db.models.constraints import UniqueConstraint
from django.contrib.auth.models import AbstractUser
@ -6,9 +15,6 @@ import kepi.bowler_pub.crypto as crypto
from kepi.bowler_pub.utils import uri_to_url
from django.utils.timezone import now
from django.core.exceptions import ValidationError
import logging
logger = logging.Logger('kepi')
class Like(models.Model):

Wyświetl plik

@ -1,3 +1,12 @@
# notification.py
#
# Part of kepi.
# Copyright (c) 2018-2020 Marnanel Thurman.
# Licensed under the GNU Public License v2.
import logging
logger = logging.getLogger(name='kepi')
from django.db import models
from django.db.models.constraints import UniqueConstraint
from django.contrib.auth.models import AbstractUser
@ -6,9 +15,6 @@ import kepi.bowler_pub.crypto as crypto
from kepi.bowler_pub.utils import uri_to_url
from django.utils.timezone import now
from django.core.exceptions import ValidationError
import logging
logger = logging.Logger('kepi')
class Notification(models.Model):

Wyświetl plik

@ -5,7 +5,7 @@
# Licensed under the GNU Public License v2.
import logging
logger = logging.Logger("kepi")
logger = logging.getLogger(name='kepi')
from polymorphic.models import PolymorphicModel
from django.db import models

Wyświetl plik

@ -1,3 +1,12 @@
# status.py
#
# Part of kepi.
# Copyright (c) 2018-2020 Marnanel Thurman.
# Licensed under the GNU Public License v2.
import logging
logger = logging.getLogger(name='kepi')
from django.db import models
from django.db.models.constraints import UniqueConstraint
from django.contrib.auth.models import AbstractUser
@ -7,11 +16,8 @@ from kepi.bowler_pub.utils import uri_to_url, is_local
import kepi.trilby_api.utils as trilby_utils
from django.utils.timezone import now
from django.core.exceptions import ValidationError
import logging
from polymorphic.models import PolymorphicModel
logger = logging.Logger('kepi')
class Status(PolymorphicModel):
class Meta:

Wyświetl plik

@ -1,9 +1,15 @@
# receivers.py
#
# Part of kepi.
# Copyright (c) 2018-2020 Marnanel Thurman.
# Licensed under the GNU Public License v2.
import logging
logger = logging.getLogger(name='kepi')
import kepi.trilby_api.signals as kepi_signals
import kepi.trilby_api.models as kepi_models
from django.dispatch import receiver
import logging
logger = logging.Logger('kepi')
##################################################
# Notification handlers

Wyświetl plik

@ -1,3 +1,12 @@
# signals.py
#
# Part of kepi.
# Copyright (c) 2018-2020 Marnanel Thurman.
# Licensed under the GNU Public License v2.
import logging
logger = logging.getLogger(name='kepi')
from django.dispatch import Signal
liked = Signal(

Wyświetl plik

@ -1,3 +1,12 @@
# test_timelines.py
#
# Part of kepi.
# Copyright (c) 2018-2020 Marnanel Thurman.
# Licensed under the GNU Public License v2.
import logging
logger = logging.getLogger(name='kepi')
from unittest import skip
from rest_framework.test import APIClient, force_authenticate
from kepi.trilby_api.views import *

Wyświetl plik

@ -1,3 +1,9 @@
# urls.py
#
# Part of kepi.
# Copyright (c) 2018-2020 Marnanel Thurman.
# Licensed under the GNU Public License v2.
from django.urls import path
from .views import *

Wyświetl plik

@ -1,3 +1,12 @@
# utils.py
#
# Part of kepi.
# Copyright (c) 2018-2020 Marnanel Thurman.
# Licensed under the GNU Public License v2.
import logging
logger = logging.getLogger(name='kepi')
VISIBILITY_PUBLIC = 'A'
VISIBILITY_UNLISTED = 'U'
VISIBILITY_PRIVATE = 'X'

Wyświetl plik

@ -1,3 +1,12 @@
# views.py
#
# Part of kepi.
# Copyright (c) 2018-2020 Marnanel Thurman.
# Licensed under the GNU Public License v2.
import logging
logger = logging.getLogger(name='kepi')
from django.db import IntegrityError, transaction
from django.shortcuts import render, get_object_or_404
from django.views import View
@ -19,11 +28,9 @@ from rest_framework.permissions import IsAuthenticated, \
from rest_framework.response import Response
from rest_framework.renderers import JSONRenderer
import kepi.trilby_api.receivers
import logging
import json
import re
logger = logging.Logger(name='kepi')
###########################