diff --git a/chapeau/kepi/__init__.py b/chapeau/bowler_pub/__init__.py similarity index 100% rename from chapeau/kepi/__init__.py rename to chapeau/bowler_pub/__init__.py diff --git a/chapeau/kepi/admin.py b/chapeau/bowler_pub/admin.py similarity index 83% rename from chapeau/kepi/admin.py rename to chapeau/bowler_pub/admin.py index 6a38774..2468390 100644 --- a/chapeau/kepi/admin.py +++ b/chapeau/bowler_pub/admin.py @@ -6,14 +6,14 @@ """ These classes are used by the admin system to interact -with kepi's models. +with bowler_pub's models. """ from django.contrib import admin from polymorphic.admin import * -from chapeau.kepi.models import * -from chapeau.kepi.validation import IncomingMessage -import chapeau.kepi.forms as kepi_forms +from chapeau.bowler_pub.models import * +from chapeau.bowler_pub.validation import IncomingMessage +import chapeau.bowler_pub.forms as bowler_pub_forms ################################### @@ -28,7 +28,7 @@ class ActivityAdmin(admin.ModelAdmin): @admin.register(AcNote) class NoteAdmin(admin.ModelAdmin): - form = kepi_forms.NoteAdminForm + form = bowler_pub_forms.NoteAdminForm base_model = AcNote ################################### diff --git a/chapeau/kepi/command_line.py b/chapeau/bowler_pub/command_line.py similarity index 90% rename from chapeau/kepi/command_line.py rename to chapeau/bowler_pub/command_line.py index 2ef6f64..5f2c397 100644 --- a/chapeau/kepi/command_line.py +++ b/chapeau/bowler_pub/command_line.py @@ -1,4 +1,4 @@ -import chapeau.kepi.settings +import chapeau.bowler_pub.settings from django.core.management import get_commands, call_command from django.core.management.base import CommandError from django.conf import settings @@ -7,9 +7,9 @@ import django import os import sys -KEPI_PREFIX = 'kepi-' +KEPI_PREFIX = 'bowler_pub-' -def kepi_commands(): +def bowler_pub_commands(): result = [] for command in sorted(get_commands().keys()): if command.startswith(KEPI_PREFIX): @@ -20,7 +20,7 @@ def kepi_commands(): def setup(): os.environ.setdefault( "DJANGO_SETTINGS_MODULE", - "kepi.settings" + "bowler_pub.settings" ) django.setup() @@ -35,7 +35,7 @@ def show_help(): column = 0 width = 70 - for command in kepi_commands(): + for command in bowler_pub_commands(): if column+len(command)+1>width: print('') diff --git a/chapeau/kepi/create.py b/chapeau/bowler_pub/create.py similarity index 93% rename from chapeau/kepi/create.py rename to chapeau/bowler_pub/create.py index 817bd53..3c4ac0f 100644 --- a/chapeau/kepi/create.py +++ b/chapeau/bowler_pub/create.py @@ -8,7 +8,7 @@ This module contains create(), which creates objects. """ -from chapeau.kepi.models import * +from chapeau.bowler_pub.models import * import django.db.utils import logging import json @@ -36,7 +36,7 @@ def create( **kwargs): """ - Creates a kepi object. + Creates a bowler_pub object. Keyword arguments: value -- the fields of the new object, as a dict. @@ -59,8 +59,8 @@ def create( Don't confuse create() with objects of type Create! """ - from chapeau.kepi.delivery import deliver - from chapeau.kepi.models.activity import AcActivity + from chapeau.bowler_pub.delivery import deliver + from chapeau.bowler_pub.models.activity import AcActivity if value is None: value = {} @@ -96,8 +96,8 @@ def create( class_name = 'Ac'+value['type'] try: - import chapeau.kepi.models as kepi_models - cls = getattr(locals()['kepi_models'], class_name) + import chapeau.bowler_pub.models as bowler_pub_models + cls = getattr(locals()['bowler_pub_models'], class_name) except AttributeError: logger.warn("There's no type called %s", class_name) diff --git a/chapeau/kepi/crypto.py b/chapeau/bowler_pub/crypto.py similarity index 100% rename from chapeau/kepi/crypto.py rename to chapeau/bowler_pub/crypto.py diff --git a/chapeau/kepi/delivery.py b/chapeau/bowler_pub/delivery.py similarity index 97% rename from chapeau/kepi/delivery.py rename to chapeau/bowler_pub/delivery.py index 13c0cfb..3462516 100644 --- a/chapeau/kepi/delivery.py +++ b/chapeau/bowler_pub/delivery.py @@ -11,8 +11,8 @@ to their audiences. from __future__ import absolute_import, unicode_literals from celery import shared_task -from chapeau.kepi.find import find, find_local, is_local -import chapeau.kepi.models +from chapeau.bowler_pub.find import find, find_local, is_local +import chapeau.bowler_pub.models from httpsig.verify import HeaderVerifier from urllib.parse import urlparse from django.http.request import HttpRequest @@ -55,7 +55,7 @@ def _find_local_actor(activity_form): the "attributedTo" field. """ - from chapeau.kepi.models.acobject import AcObject + from chapeau.bowler_pub.models.acobject import AcObject parts = None for fieldname in ['actor', 'attributedTo']: @@ -216,8 +216,8 @@ def _activity_form_to_outgoing_string(activity_form): an HTTP response. """ - from chapeau.kepi import ATSIGN_CONTEXT - from chapeau.kepi.utils import as_json + from chapeau.bowler_pub import ATSIGN_CONTEXT + from chapeau.bowler_pub.utils import as_json format_for_delivery = activity_form.copy() for blind_field in ['bto', 'bcc']: @@ -414,8 +414,8 @@ def deliver( """ try: - activity = chapeau.kepi.models.AcActivity.objects.get(id=activity_id) - except chapeau.kepi.models.AcActivity.DoesNotExist: + activity = chapeau.bowler_pub.models.AcActivity.objects.get(id=activity_id) + except chapeau.bowler_pub.models.AcActivity.DoesNotExist: logger.warn("Can't deliver activity %s because it doesn't exist", activity_id) return None diff --git a/chapeau/kepi/find.py b/chapeau/bowler_pub/find.py similarity index 97% rename from chapeau/kepi/find.py rename to chapeau/bowler_pub/find.py index 6aec874..afc15d2 100644 --- a/chapeau/kepi/find.py +++ b/chapeau/bowler_pub/find.py @@ -15,9 +15,9 @@ from django.conf import settings import django.urls from urllib.parse import urlparse from django.http.request import HttpRequest -from chapeau.kepi.create import create +from chapeau.bowler_pub.create import create from django.utils import timezone -from chapeau.kepi.utils import is_short_id +from chapeau.bowler_pub.utils import is_short_id import json import mimeparse @@ -145,7 +145,7 @@ def find_remote(url, its stated audiences. This is usually not what you want. """ - from chapeau.kepi.models.acobject import AcObject + from chapeau.bowler_pub.models.acobject import AcObject logger.debug('%s: find remote', url) @@ -279,7 +279,7 @@ def _short_id_lookup(number): """ - from chapeau.kepi.models import AcObject + from chapeau.bowler_pub.models import AcObject try: result = AcObject.objects.get( diff --git a/chapeau/kepi/fixtures/kepi1.json b/chapeau/bowler_pub/fixtures/kepi1.json similarity index 77% rename from chapeau/kepi/fixtures/kepi1.json rename to chapeau/bowler_pub/fixtures/kepi1.json index d966662..e5c3a77 100644 --- a/chapeau/kepi/fixtures/kepi1.json +++ b/chapeau/bowler_pub/fixtures/kepi1.json @@ -1,6 +1,6 @@ [ { - "model": "kepi.ActivityObject", + "model": "bowler_pub.ActivityObject", "pk": 1, "fields": { "a_type": "Object", @@ -8,7 +8,7 @@ } }, { - "model": "kepi.ActivityObject", + "model": "bowler_pub.ActivityObject", "pk": 2, "fields": { "a_type": "Object", @@ -16,7 +16,7 @@ } }, { - "model": "kepi.ActivityObject", + "model": "bowler_pub.ActivityObject", "pk": 3, "fields": { "a_type": "Person", diff --git a/chapeau/kepi/forms.py b/chapeau/bowler_pub/forms.py similarity index 84% rename from chapeau/kepi/forms.py rename to chapeau/bowler_pub/forms.py index b9bb3e9..2763486 100644 --- a/chapeau/kepi/forms.py +++ b/chapeau/bowler_pub/forms.py @@ -10,12 +10,12 @@ the admin interface. It's not very elaborate yet. """ from django import forms -import chapeau.kepi.models as kepi_models +import chapeau.bowler_pub.models as bowler_pub_models class NoteAdminForm(forms.ModelForm): class Meta: - model = kepi_models.AcNote + model = bowler_pub_models.AcNote fields = [ 'f_content', diff --git a/chapeau/kepi/management/__init__.py b/chapeau/bowler_pub/management/__init__.py similarity index 98% rename from chapeau/kepi/management/__init__.py rename to chapeau/bowler_pub/management/__init__.py index 680a126..9aba9b2 100644 --- a/chapeau/kepi/management/__init__.py +++ b/chapeau/bowler_pub/management/__init__.py @@ -1,5 +1,5 @@ from django.core.management.base import BaseCommand, CommandError -from chapeau.kepi.models import * +from chapeau.bowler_pub.models import * from django.conf import settings import logging import os diff --git a/chapeau/kepi/management/commands/__init__.py b/chapeau/bowler_pub/management/commands/__init__.py similarity index 100% rename from chapeau/kepi/management/commands/__init__.py rename to chapeau/bowler_pub/management/commands/__init__.py diff --git a/chapeau/kepi/management/commands/kepi-delete.py b/chapeau/bowler_pub/management/commands/kepi-delete.py similarity index 92% rename from chapeau/kepi/management/commands/kepi-delete.py rename to chapeau/bowler_pub/management/commands/kepi-delete.py index 4b94148..72f4bf4 100644 --- a/chapeau/kepi/management/commands/kepi-delete.py +++ b/chapeau/bowler_pub/management/commands/kepi-delete.py @@ -1,8 +1,8 @@ from django.core.management.base import BaseCommand, CommandError from django.conf import settings -from chapeau.kepi.models import * -from chapeau.kepi.create import create -from chapeau.kepi.management import KepiCommand, objects_by_keywords +from chapeau.bowler_pub.models import * +from chapeau.bowler_pub.create import create +from chapeau.bowler_pub.management import KepiCommand, objects_by_keywords import os import logging import json diff --git a/chapeau/kepi/management/commands/kepi-follow.py b/chapeau/bowler_pub/management/commands/kepi-follow.py similarity index 84% rename from chapeau/kepi/management/commands/kepi-follow.py rename to chapeau/bowler_pub/management/commands/kepi-follow.py index a0c299b..548b78b 100644 --- a/chapeau/kepi/management/commands/kepi-follow.py +++ b/chapeau/bowler_pub/management/commands/kepi-follow.py @@ -1,8 +1,8 @@ from django.core.management.base import BaseCommand, CommandError from django.conf import settings -from chapeau.kepi.models import * -from chapeau.kepi.create import create -from chapeau.kepi.management import KepiCommand +from chapeau.bowler_pub.models import * +from chapeau.bowler_pub.create import create +from chapeau.bowler_pub.management import KepiCommand import os import logging diff --git a/chapeau/kepi/management/commands/kepi-list.py b/chapeau/bowler_pub/management/commands/kepi-list.py similarity index 87% rename from chapeau/kepi/management/commands/kepi-list.py rename to chapeau/bowler_pub/management/commands/kepi-list.py index 70a20ac..fa84a0f 100644 --- a/chapeau/kepi/management/commands/kepi-list.py +++ b/chapeau/bowler_pub/management/commands/kepi-list.py @@ -1,8 +1,8 @@ from django.core.management.base import BaseCommand, CommandError from django.conf import settings -from chapeau.kepi.models import * -from chapeau.kepi.create import create -from chapeau.kepi.management import KepiCommand +from chapeau.bowler_pub.models import * +from chapeau.bowler_pub.create import create +from chapeau.bowler_pub.management import KepiCommand import os import logging diff --git a/chapeau/kepi/management/commands/kepi-new.py b/chapeau/bowler_pub/management/commands/kepi-new.py similarity index 94% rename from chapeau/kepi/management/commands/kepi-new.py rename to chapeau/bowler_pub/management/commands/kepi-new.py index a3ac6c4..67dbbb2 100644 --- a/chapeau/kepi/management/commands/kepi-new.py +++ b/chapeau/bowler_pub/management/commands/kepi-new.py @@ -1,5 +1,5 @@ -from chapeau.kepi.create import create -from chapeau.kepi.management import KepiCommand +from chapeau.bowler_pub.create import create +from chapeau.bowler_pub.management import KepiCommand import logging logger = logging.Logger('chapeau') diff --git a/chapeau/kepi/management/commands/kepi-post.py b/chapeau/bowler_pub/management/commands/kepi-post.py similarity index 93% rename from chapeau/kepi/management/commands/kepi-post.py rename to chapeau/bowler_pub/management/commands/kepi-post.py index 97b652a..751dcb0 100644 --- a/chapeau/kepi/management/commands/kepi-post.py +++ b/chapeau/bowler_pub/management/commands/kepi-post.py @@ -1,8 +1,8 @@ from django.core.management.base import BaseCommand, CommandError from django.conf import settings -from chapeau.kepi.models import * -from chapeau.kepi.create import create -from chapeau.kepi.management import KepiCommand +from chapeau.bowler_pub.models import * +from chapeau.bowler_pub.create import create +from chapeau.bowler_pub.management import KepiCommand import os import logging diff --git a/chapeau/kepi/management/commands/kepi-show.py b/chapeau/bowler_pub/management/commands/kepi-show.py similarity index 95% rename from chapeau/kepi/management/commands/kepi-show.py rename to chapeau/bowler_pub/management/commands/kepi-show.py index 51bec6d..40d91cc 100644 --- a/chapeau/kepi/management/commands/kepi-show.py +++ b/chapeau/bowler_pub/management/commands/kepi-show.py @@ -1,8 +1,8 @@ from django.core.management.base import BaseCommand, CommandError from django.conf import settings -from chapeau.kepi.models import * -from chapeau.kepi.create import create -from chapeau.kepi.management import KepiCommand, objects_by_keywords +from chapeau.bowler_pub.models import * +from chapeau.bowler_pub.create import create +from chapeau.bowler_pub.management import KepiCommand, objects_by_keywords from collections import abc import os import logging @@ -128,7 +128,7 @@ class Command(KepiCommand): def _show_json(self, thing, *args, **options): - from chapeau.kepi.utils import as_json + from chapeau.bowler_pub.utils import as_json print(as_json(thing.activity_form)) diff --git a/chapeau/kepi/management/commands/kepi-users.py b/chapeau/bowler_pub/management/commands/kepi-users.py similarity index 90% rename from chapeau/kepi/management/commands/kepi-users.py rename to chapeau/bowler_pub/management/commands/kepi-users.py index a90853f..522d585 100644 --- a/chapeau/kepi/management/commands/kepi-users.py +++ b/chapeau/bowler_pub/management/commands/kepi-users.py @@ -1,8 +1,8 @@ from django.core.management.base import BaseCommand, CommandError from django.conf import settings -from chapeau.kepi.models import * -from chapeau.kepi.create import create -from chapeau.kepi.management import KepiCommand +from chapeau.bowler_pub.models import * +from chapeau.bowler_pub.create import create +from chapeau.bowler_pub.management import KepiCommand import os import logging @@ -37,7 +37,7 @@ class Command(KepiCommand): self.stdout.write( self.style.ERROR( "No users found. To create a user, use "+\ - "'kepi users --create fred'." + "'bowler_pub users --create fred'." )) return diff --git a/chapeau/kepi/middleware.py b/chapeau/bowler_pub/middleware.py similarity index 100% rename from chapeau/kepi/middleware.py rename to chapeau/bowler_pub/middleware.py diff --git a/chapeau/kepi/migrations/0001_initial.py b/chapeau/bowler_pub/migrations/0001_initial.py similarity index 81% rename from chapeau/kepi/migrations/0001_initial.py rename to chapeau/bowler_pub/migrations/0001_initial.py index 859f028..b502f4c 100644 --- a/chapeau/kepi/migrations/0001_initial.py +++ b/chapeau/bowler_pub/migrations/0001_initial.py @@ -21,7 +21,7 @@ class Migration(migrations.Migration): ('id', models.CharField(default=None, editable=False, max_length=255, primary_key=True, serialize=False, unique=True)), ('published', models.DateTimeField(default=django.utils.timezone.now)), ('updated', models.DateTimeField(auto_now=True)), - ('polymorphic_ctype', models.ForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='polymorphic_kepi.acobject_set+', to='contenttypes.ContentType')), + ('polymorphic_ctype', models.ForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='polymorphic_bowler_pub.acobject_set+', to='contenttypes.ContentType')), ], options={ 'abstract': False, @@ -69,19 +69,19 @@ class Migration(migrations.Migration): migrations.CreateModel( name='AcActivity', fields=[ - ('acobject_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='kepi.AcObject')), + ('acobject_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='bowler_pub.AcObject')), ('f_actor', models.CharField(blank=True, default=None, max_length=255, null=True)), ], options={ 'verbose_name': 'activity', 'verbose_name_plural': 'activities', }, - bases=('kepi.acobject',), + bases=('bowler_pub.acobject',), ), migrations.CreateModel( name='AcActor', fields=[ - ('acobject_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='kepi.AcObject')), + ('acobject_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='bowler_pub.AcObject')), ('privateKey', models.TextField(blank=True, null=True)), ('f_name', models.TextField(help_text='Your name, in human-friendly form. Something like "Alice Liddell".', verbose_name='name')), ('f_publicKey', models.TextField(blank=True, null=True, verbose_name='public key')), @@ -94,12 +94,12 @@ class Migration(migrations.Migration): 'abstract': False, 'base_manager_name': 'objects', }, - bases=('kepi.acobject',), + bases=('bowler_pub.acobject',), ), migrations.CreateModel( name='AcItem', fields=[ - ('acobject_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='kepi.AcObject')), + ('acobject_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='bowler_pub.AcObject')), ('f_content', models.CharField(blank=True, max_length=255)), ('f_attributedTo', models.CharField(blank=True, max_length=255)), ], @@ -107,7 +107,7 @@ class Migration(migrations.Migration): 'abstract': False, 'base_manager_name': 'objects', }, - bases=('kepi.acobject',), + bases=('bowler_pub.acobject',), ), migrations.CreateModel( name='ThingField', @@ -115,7 +115,7 @@ class Migration(migrations.Migration): ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('field', models.CharField(max_length=255)), ('value', models.CharField(blank=True, default=None, max_length=255, null=True)), - ('parent', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='kepi.AcObject')), + ('parent', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='bowler_pub.AcObject')), ], ), migrations.CreateModel( @@ -123,15 +123,15 @@ class Migration(migrations.Migration): fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('to_actor', models.CharField(max_length=255)), - ('from_status', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='kepi.AcObject')), + ('from_status', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='bowler_pub.AcObject')), ], ), migrations.CreateModel( name='CollectionMember', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('member', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='kepi.AcObject')), - ('parent', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='kepi.Collection')), + ('member', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='bowler_pub.AcObject')), + ('parent', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='bowler_pub.Collection')), ], ), migrations.CreateModel( @@ -140,304 +140,304 @@ class Migration(migrations.Migration): ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('field', models.PositiveSmallIntegerField(choices=[(1, 'audience'), (2, 'to'), (4, 'cc'), (114, 'bto'), (116, 'bcc')])), ('recipient', models.CharField(max_length=255)), - ('parent', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='kepi.AcObject')), + ('parent', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='bowler_pub.AcObject')), ], ), migrations.CreateModel( name='AcAccept', fields=[ - ('acactivity_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='kepi.AcActivity')), + ('acactivity_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='bowler_pub.AcActivity')), ], options={ 'abstract': False, 'base_manager_name': 'objects', }, - bases=('kepi.acactivity',), + bases=('bowler_pub.acactivity',), ), migrations.CreateModel( name='AcAdd', fields=[ - ('acactivity_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='kepi.AcActivity')), + ('acactivity_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='bowler_pub.AcActivity')), ], options={ 'abstract': False, 'base_manager_name': 'objects', }, - bases=('kepi.acactivity',), + bases=('bowler_pub.acactivity',), ), migrations.CreateModel( name='AcAnnounce', fields=[ - ('acactivity_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='kepi.AcActivity')), + ('acactivity_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='bowler_pub.AcActivity')), ], options={ 'abstract': False, 'base_manager_name': 'objects', }, - bases=('kepi.acactivity',), + bases=('bowler_pub.acactivity',), ), migrations.CreateModel( name='AcApplication', fields=[ - ('acactor_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='kepi.AcActor')), + ('acactor_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='bowler_pub.AcActor')), ], options={ 'abstract': False, 'base_manager_name': 'objects', }, - bases=('kepi.acactor',), + bases=('bowler_pub.acactor',), ), migrations.CreateModel( name='AcArticle', fields=[ - ('acitem_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='kepi.AcItem')), + ('acitem_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='bowler_pub.AcItem')), ], options={ 'abstract': False, 'base_manager_name': 'objects', }, - bases=('kepi.acitem',), + bases=('bowler_pub.acitem',), ), migrations.CreateModel( name='AcAudio', fields=[ - ('acitem_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='kepi.AcItem')), + ('acitem_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='bowler_pub.AcItem')), ], options={ 'abstract': False, 'base_manager_name': 'objects', }, - bases=('kepi.acitem',), + bases=('bowler_pub.acitem',), ), migrations.CreateModel( name='AcCreate', fields=[ - ('acactivity_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='kepi.AcActivity')), + ('acactivity_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='bowler_pub.AcActivity')), ], options={ 'abstract': False, 'base_manager_name': 'objects', }, - bases=('kepi.acactivity',), + bases=('bowler_pub.acactivity',), ), migrations.CreateModel( name='AcDelete', fields=[ - ('acactivity_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='kepi.AcActivity')), + ('acactivity_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='bowler_pub.AcActivity')), ], options={ 'abstract': False, 'base_manager_name': 'objects', }, - bases=('kepi.acactivity',), + bases=('bowler_pub.acactivity',), ), migrations.CreateModel( name='AcDocument', fields=[ - ('acitem_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='kepi.AcItem')), + ('acitem_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='bowler_pub.AcItem')), ], options={ 'abstract': False, 'base_manager_name': 'objects', }, - bases=('kepi.acitem',), + bases=('bowler_pub.acitem',), ), migrations.CreateModel( name='AcEvent', fields=[ - ('acitem_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='kepi.AcItem')), + ('acitem_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='bowler_pub.AcItem')), ], options={ 'abstract': False, 'base_manager_name': 'objects', }, - bases=('kepi.acitem',), + bases=('bowler_pub.acitem',), ), migrations.CreateModel( name='AcFollow', fields=[ - ('acactivity_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='kepi.AcActivity')), + ('acactivity_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='bowler_pub.AcActivity')), ], options={ 'abstract': False, 'base_manager_name': 'objects', }, - bases=('kepi.acactivity',), + bases=('bowler_pub.acactivity',), ), migrations.CreateModel( name='AcGroup', fields=[ - ('acactor_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='kepi.AcActor')), + ('acactor_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='bowler_pub.AcActor')), ], options={ 'abstract': False, 'base_manager_name': 'objects', }, - bases=('kepi.acactor',), + bases=('bowler_pub.acactor',), ), migrations.CreateModel( name='AcImage', fields=[ - ('acitem_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='kepi.AcItem')), + ('acitem_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='bowler_pub.AcItem')), ], options={ 'abstract': False, 'base_manager_name': 'objects', }, - bases=('kepi.acitem',), + bases=('bowler_pub.acitem',), ), migrations.CreateModel( name='AcLike', fields=[ - ('acactivity_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='kepi.AcActivity')), + ('acactivity_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='bowler_pub.AcActivity')), ], options={ 'abstract': False, 'base_manager_name': 'objects', }, - bases=('kepi.acactivity',), + bases=('bowler_pub.acactivity',), ), migrations.CreateModel( name='AcNote', fields=[ - ('acitem_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='kepi.AcItem')), + ('acitem_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='bowler_pub.AcItem')), ], options={ 'verbose_name': 'note', }, - bases=('kepi.acitem',), + bases=('bowler_pub.acitem',), ), migrations.CreateModel( name='AcOrganization', fields=[ - ('acactor_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='kepi.AcActor')), + ('acactor_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='bowler_pub.AcActor')), ], options={ 'abstract': False, 'base_manager_name': 'objects', }, - bases=('kepi.acactor',), + bases=('bowler_pub.acactor',), ), migrations.CreateModel( name='AcPage', fields=[ - ('acitem_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='kepi.AcItem')), + ('acitem_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='bowler_pub.AcItem')), ], options={ 'abstract': False, 'base_manager_name': 'objects', }, - bases=('kepi.acitem',), + bases=('bowler_pub.acitem',), ), migrations.CreateModel( name='AcPerson', fields=[ - ('acactor_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='kepi.AcActor')), + ('acactor_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='bowler_pub.AcActor')), ], options={ 'verbose_name': 'person', 'verbose_name_plural': 'people', }, - bases=('kepi.acactor',), + bases=('bowler_pub.acactor',), ), migrations.CreateModel( name='AcPlace', fields=[ - ('acitem_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='kepi.AcItem')), + ('acitem_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='bowler_pub.AcItem')), ], options={ 'abstract': False, 'base_manager_name': 'objects', }, - bases=('kepi.acitem',), + bases=('bowler_pub.acitem',), ), migrations.CreateModel( name='AcProfile', fields=[ - ('acitem_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='kepi.AcItem')), + ('acitem_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='bowler_pub.AcItem')), ], options={ 'abstract': False, 'base_manager_name': 'objects', }, - bases=('kepi.acitem',), + bases=('bowler_pub.acitem',), ), migrations.CreateModel( name='AcReject', fields=[ - ('acactivity_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='kepi.AcActivity')), + ('acactivity_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='bowler_pub.AcActivity')), ], options={ 'abstract': False, 'base_manager_name': 'objects', }, - bases=('kepi.acactivity',), + bases=('bowler_pub.acactivity',), ), migrations.CreateModel( name='AcRelationship', fields=[ - ('acitem_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='kepi.AcItem')), + ('acitem_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='bowler_pub.AcItem')), ], options={ 'abstract': False, 'base_manager_name': 'objects', }, - bases=('kepi.acitem',), + bases=('bowler_pub.acitem',), ), migrations.CreateModel( name='AcRemove', fields=[ - ('acactivity_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='kepi.AcActivity')), + ('acactivity_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='bowler_pub.AcActivity')), ], options={ 'abstract': False, 'base_manager_name': 'objects', }, - bases=('kepi.acactivity',), + bases=('bowler_pub.acactivity',), ), migrations.CreateModel( name='AcService', fields=[ - ('acactor_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='kepi.AcActor')), + ('acactor_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='bowler_pub.AcActor')), ], options={ 'abstract': False, 'base_manager_name': 'objects', }, - bases=('kepi.acactor',), + bases=('bowler_pub.acactor',), ), migrations.CreateModel( name='AcUndo', fields=[ - ('acactivity_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='kepi.AcActivity')), + ('acactivity_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='bowler_pub.AcActivity')), ], options={ 'abstract': False, 'base_manager_name': 'objects', }, - bases=('kepi.acactivity',), + bases=('bowler_pub.acactivity',), ), migrations.CreateModel( name='AcUpdate', fields=[ - ('acactivity_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='kepi.AcActivity')), + ('acactivity_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='bowler_pub.AcActivity')), ], options={ 'abstract': False, 'base_manager_name': 'objects', }, - bases=('kepi.acactivity',), + bases=('bowler_pub.acactivity',), ), migrations.CreateModel( name='AcVideo', fields=[ - ('acitem_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='kepi.AcItem')), + ('acitem_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='bowler_pub.AcItem')), ], options={ 'abstract': False, 'base_manager_name': 'objects', }, - bases=('kepi.acitem',), + bases=('bowler_pub.acitem',), ), migrations.AddConstraint( model_name='thingfield', @@ -446,7 +446,7 @@ class Migration(migrations.Migration): migrations.AddField( model_name='collection', name='owner', - field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='kepi.AcActor'), + field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='bowler_pub.AcActor'), ), migrations.AddConstraint( model_name='collection', diff --git a/chapeau/kepi/migrations/0002_acitem_serial.py b/chapeau/bowler_pub/migrations/0002_acitem_serial.py similarity index 89% rename from chapeau/kepi/migrations/0002_acitem_serial.py rename to chapeau/bowler_pub/migrations/0002_acitem_serial.py index 3b8c728..7bca3cd 100644 --- a/chapeau/kepi/migrations/0002_acitem_serial.py +++ b/chapeau/bowler_pub/migrations/0002_acitem_serial.py @@ -6,7 +6,7 @@ from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ - ('kepi', '0001_initial'), + ('bowler_pub', '0001_initial'), ] operations = [ diff --git a/chapeau/kepi/migrations/0003_auto_20191116_1539.py b/chapeau/bowler_pub/migrations/0003_auto_20191116_1539.py similarity index 87% rename from chapeau/kepi/migrations/0003_auto_20191116_1539.py rename to chapeau/bowler_pub/migrations/0003_auto_20191116_1539.py index 9150cce..d41a12c 100644 --- a/chapeau/kepi/migrations/0003_auto_20191116_1539.py +++ b/chapeau/bowler_pub/migrations/0003_auto_20191116_1539.py @@ -6,7 +6,7 @@ from django.db import migrations class Migration(migrations.Migration): dependencies = [ - ('kepi', '0002_acitem_serial'), + ('bowler_pub', '0002_acitem_serial'), ] operations = [ diff --git a/chapeau/kepi/migrations/__init__.py b/chapeau/bowler_pub/migrations/__init__.py similarity index 100% rename from chapeau/kepi/migrations/__init__.py rename to chapeau/bowler_pub/migrations/__init__.py diff --git a/chapeau/kepi/models/README.md b/chapeau/bowler_pub/models/README.md similarity index 100% rename from chapeau/kepi/models/README.md rename to chapeau/bowler_pub/models/README.md diff --git a/chapeau/kepi/models/__init__.py b/chapeau/bowler_pub/models/__init__.py similarity index 100% rename from chapeau/kepi/models/__init__.py rename to chapeau/bowler_pub/models/__init__.py diff --git a/chapeau/kepi/models/acobject.py b/chapeau/bowler_pub/models/acobject.py similarity index 94% rename from chapeau/kepi/models/acobject.py rename to chapeau/bowler_pub/models/acobject.py index a452d51..4e45e14 100644 --- a/chapeau/kepi/models/acobject.py +++ b/chapeau/bowler_pub/models/acobject.py @@ -3,12 +3,12 @@ from django.conf import settings from django.utils import timezone from polymorphic.models import PolymorphicModel from polymorphic.managers import PolymorphicManager -from chapeau.kepi.models.audience import Audience, AUDIENCE_FIELD_NAMES -from chapeau.kepi.models.thingfield import ThingField -from chapeau.kepi.models.mention import Mention -from chapeau.kepi.utils import configured_path, uri_to_url +from chapeau.bowler_pub.models.audience import Audience, AUDIENCE_FIELD_NAMES +from chapeau.bowler_pub.models.thingfield import ThingField +from chapeau.bowler_pub.models.mention import Mention +from chapeau.bowler_pub.utils import configured_path, uri_to_url from .. import URL_REGEXP, SERIAL_NUMBER_REGEXP -import chapeau.kepi.side_effects as side_effects +import chapeau.bowler_pub.side_effects as side_effects import logging import random import warnings @@ -152,7 +152,7 @@ class AcObject(PolymorphicModel): @property def activity_form(self): - from chapeau.kepi.utils import short_id_to_url + from chapeau.bowler_pub.utils import short_id_to_url result = { 'id': self.url, @@ -189,7 +189,7 @@ class AcObject(PolymorphicModel): def __getitem__(self, name): - from chapeau.kepi.find import find + from chapeau.bowler_pub.find import find name_parts = name.split('__') name = name_parts.pop(0) @@ -265,7 +265,7 @@ class AcObject(PolymorphicModel): ) else: - from chapeau.kepi.utils import as_json + from chapeau.bowler_pub.utils import as_json if self.pk is None: # See above @@ -304,8 +304,8 @@ class AcObject(PolymorphicModel): def run_side_effects(self): - from chapeau.kepi.find import find - from chapeau.kepi.delivery import deliver + from chapeau.bowler_pub.find import find + from chapeau.bowler_pub.delivery import deliver f_type = self.f_type.lower() @@ -410,7 +410,7 @@ class AcObject(PolymorphicModel): find() would ignore these. """ - from chapeau.kepi.find import find + from chapeau.bowler_pub.find import find logger.debug(' -- finding object with url %s', url) result = find(url, diff --git a/chapeau/kepi/models/activity.py b/chapeau/bowler_pub/models/activity.py similarity index 95% rename from chapeau/kepi/models/activity.py rename to chapeau/bowler_pub/models/activity.py index df1f30b..caef180 100644 --- a/chapeau/kepi/models/activity.py +++ b/chapeau/bowler_pub/models/activity.py @@ -23,8 +23,8 @@ class AcActivity(acobject.AcObject): def go_into_outbox_if_local(self): - from chapeau.kepi.models.collection import Collection - from chapeau.kepi.find import find + from chapeau.bowler_pub.models.collection import Collection + from chapeau.bowler_pub.find import find if not self.is_local: return diff --git a/chapeau/kepi/models/actor.py b/chapeau/bowler_pub/models/actor.py similarity index 97% rename from chapeau/kepi/models/actor.py rename to chapeau/bowler_pub/models/actor.py index 5090c20..ddd4333 100644 --- a/chapeau/kepi/models/actor.py +++ b/chapeau/bowler_pub/models/actor.py @@ -1,8 +1,8 @@ from django.db import models from django.conf import settings from . import acobject, following, collection -import chapeau.kepi.crypto as crypto -from chapeau.kepi.utils import configured_url, uri_to_url +import chapeau.bowler_pub.crypto as crypto +from chapeau.bowler_pub.utils import configured_url, uri_to_url import logging import re @@ -122,7 +122,7 @@ class AcActor(acobject.AcObject): elif name=='publicKey': - from chapeau.kepi.utils import as_json + from chapeau.bowler_pub.utils import as_json self.publicKey = as_json(value, indent=None) diff --git a/chapeau/kepi/models/audience.py b/chapeau/bowler_pub/models/audience.py similarity index 98% rename from chapeau/kepi/models/audience.py rename to chapeau/bowler_pub/models/audience.py index 371aa9c..f42ef2e 100644 --- a/chapeau/kepi/models/audience.py +++ b/chapeau/bowler_pub/models/audience.py @@ -28,7 +28,7 @@ AUDIENCE_FIELD_KEYS = set([v for (f,v) in FIELD_CHOICES]) class Audience(models.Model): parent = models.ForeignKey( - 'kepi.AcObject', + 'bowler_pub.AcObject', on_delete = models.CASCADE, ) diff --git a/chapeau/kepi/models/collection.py b/chapeau/bowler_pub/models/collection.py similarity index 98% rename from chapeau/kepi/models/collection.py rename to chapeau/bowler_pub/models/collection.py index 89b06eb..9d938dc 100644 --- a/chapeau/kepi/models/collection.py +++ b/chapeau/bowler_pub/models/collection.py @@ -8,7 +8,7 @@ logger = logging.getLogger(name='chapeau') class Collection(models.Model): owner = models.ForeignKey( - 'kepi.AcActor', + 'bowler_pub.AcActor', on_delete = models.DO_NOTHING, ) @@ -130,7 +130,7 @@ class CollectionMember(models.Model): ) member = models.ForeignKey( - 'kepi.AcObject', + 'bowler_pub.AcObject', on_delete = models.DO_NOTHING, ) diff --git a/chapeau/kepi/models/following.py b/chapeau/bowler_pub/models/following.py similarity index 98% rename from chapeau/kepi/models/following.py rename to chapeau/bowler_pub/models/following.py index e87b620..876b255 100644 --- a/chapeau/kepi/models/following.py +++ b/chapeau/bowler_pub/models/following.py @@ -1,5 +1,5 @@ from django.db import models -from chapeau.kepi.utils import short_id_to_url +from chapeau.bowler_pub.utils import short_id_to_url import logging logger = logging.getLogger(name='chapeau') diff --git a/chapeau/kepi/models/item.py b/chapeau/bowler_pub/models/item.py similarity index 98% rename from chapeau/kepi/models/item.py rename to chapeau/bowler_pub/models/item.py index 950d7ba..8abbe78 100644 --- a/chapeau/kepi/models/item.py +++ b/chapeau/bowler_pub/models/item.py @@ -122,7 +122,7 @@ class AcItem(acobject.AcObject): @property def thread(self): - from chapeau.kepi.find import find + from chapeau.bowler_pub.find import find if hasattr(self, '_thread'): return self._thread @@ -190,7 +190,7 @@ class AcItem(acobject.AcObject): in which case this property will be None. You can still find the name of the actor in f_attributedTo. """ - from chapeau.kepi.find import find + from chapeau.bowler_pub.find import find return find(self.f_attributedTo, local_only=True) @@ -200,7 +200,7 @@ class AcItem(acobject.AcObject): @property def mentions(self): - from chapeau.kepi.models.mention import Mention + from chapeau.bowler_pub.models.mention import Mention logger.info('Finding Mentions for %s', self) return [x.to_actor for x in diff --git a/chapeau/kepi/models/mention.py b/chapeau/bowler_pub/models/mention.py similarity index 97% rename from chapeau/kepi/models/mention.py rename to chapeau/bowler_pub/models/mention.py index eec5acd..218326a 100644 --- a/chapeau/kepi/models/mention.py +++ b/chapeau/bowler_pub/models/mention.py @@ -8,7 +8,7 @@ logger = logging.getLogger(name='chapeau') class Mention(models.Model): from_status = models.ForeignKey( - 'kepi.AcObject', + 'bowler_pub.AcObject', on_delete = models.DO_NOTHING, ) diff --git a/chapeau/kepi/models/thingfield.py b/chapeau/bowler_pub/models/thingfield.py similarity index 97% rename from chapeau/kepi/models/thingfield.py rename to chapeau/bowler_pub/models/thingfield.py index 7a44db0..38d33cb 100644 --- a/chapeau/kepi/models/thingfield.py +++ b/chapeau/bowler_pub/models/thingfield.py @@ -26,7 +26,7 @@ class ThingField(models.Model): ) parent = models.ForeignKey( - 'kepi.AcObject', + 'bowler_pub.AcObject', on_delete = models.CASCADE, ) diff --git a/chapeau/kepi/side_effects.py b/chapeau/bowler_pub/side_effects.py similarity index 90% rename from chapeau/kepi/side_effects.py rename to chapeau/bowler_pub/side_effects.py index d705e1f..3568d85 100644 --- a/chapeau/kepi/side_effects.py +++ b/chapeau/bowler_pub/side_effects.py @@ -13,14 +13,14 @@ the new activity as a parameter. import logging from django.conf import settings -from chapeau.kepi.find import find, is_local -from chapeau.kepi.delivery import deliver +from chapeau.bowler_pub.find import find, is_local +from chapeau.bowler_pub.delivery import deliver logger = logging.getLogger(name='chapeau') def accept(activity): - from chapeau.kepi.models.following import Following + from chapeau.bowler_pub.models.following import Following obj = activity['object__obj'] @@ -40,8 +40,8 @@ def accept(activity): def follow(activity): - from chapeau.kepi.models.following import Following - from chapeau.kepi.create import create + from chapeau.bowler_pub.models.following import Following + from chapeau.bowler_pub.create import create if not is_local(activity['object']): logger.info('Following a remote user has no local side-effects.') @@ -72,7 +72,7 @@ def follow(activity): def reject(activity): - from chapeau.kepi.models.following import Following + from chapeau.bowler_pub.models.following import Following obj = activity['object__obj'] @@ -92,9 +92,9 @@ def reject(activity): def create(activity): - import chapeau.kepi.models as kepi_models - from chapeau.kepi.create import create as kepi_create - from chapeau.kepi.models.audience import AUDIENCE_FIELD_KEYS + import chapeau.bowler_pub.models as bowler_pub_models + from chapeau.bowler_pub.create import create as bowler_pub_create + from chapeau.bowler_pub.models.audience import AUDIENCE_FIELD_KEYS raw_material = activity['object'].copy() @@ -112,9 +112,9 @@ def create(activity): raw_material[field] = value try: - if not issubclass(getattr(kepi_models, + if not issubclass(getattr(bowler_pub_models, 'Ac'+f_type), - kepi_models.AcItem): + bowler_pub_models.AcItem): logger.warn('Attempt to use Create to create '+\ 'an object of type %s. '+\ @@ -147,7 +147,7 @@ def create(activity): def it_is_relevant(something, activity): - from chapeau.kepi.models import Audience + from chapeau.bowler_pub.models import Audience logger.debug('Checking whether the new object is relevant to us.') @@ -204,7 +204,7 @@ def create(activity): logger.debug(' -- does actor %s have local followers?', activity['actor']) try: - if kepi_models.Following.objects.filter( + if bowler_pub_models.Following.objects.filter( following = activity['actor'], ): logger.debug(' -- yes!') @@ -222,7 +222,7 @@ def create(activity): 'To be honest, that\'s none of our business.') return False - creation = kepi_create( + creation = bowler_pub_create( value = raw_material, is_local_user = activity.is_local, run_side_effects = False, diff --git a/chapeau/kepi/static/defaults/avatar_0.jpg b/chapeau/bowler_pub/static/defaults/avatar_0.jpg similarity index 100% rename from chapeau/kepi/static/defaults/avatar_0.jpg rename to chapeau/bowler_pub/static/defaults/avatar_0.jpg diff --git a/chapeau/kepi/static/defaults/avatar_1.jpg b/chapeau/bowler_pub/static/defaults/avatar_1.jpg similarity index 100% rename from chapeau/kepi/static/defaults/avatar_1.jpg rename to chapeau/bowler_pub/static/defaults/avatar_1.jpg diff --git a/chapeau/kepi/static/defaults/avatar_2.jpg b/chapeau/bowler_pub/static/defaults/avatar_2.jpg similarity index 100% rename from chapeau/kepi/static/defaults/avatar_2.jpg rename to chapeau/bowler_pub/static/defaults/avatar_2.jpg diff --git a/chapeau/kepi/static/defaults/avatar_3.jpg b/chapeau/bowler_pub/static/defaults/avatar_3.jpg similarity index 100% rename from chapeau/kepi/static/defaults/avatar_3.jpg rename to chapeau/bowler_pub/static/defaults/avatar_3.jpg diff --git a/chapeau/kepi/static/defaults/avatar_4.jpg b/chapeau/bowler_pub/static/defaults/avatar_4.jpg similarity index 100% rename from chapeau/kepi/static/defaults/avatar_4.jpg rename to chapeau/bowler_pub/static/defaults/avatar_4.jpg diff --git a/chapeau/kepi/static/defaults/avatar_5.jpg b/chapeau/bowler_pub/static/defaults/avatar_5.jpg similarity index 100% rename from chapeau/kepi/static/defaults/avatar_5.jpg rename to chapeau/bowler_pub/static/defaults/avatar_5.jpg diff --git a/chapeau/kepi/static/defaults/avatar_6.jpg b/chapeau/bowler_pub/static/defaults/avatar_6.jpg similarity index 100% rename from chapeau/kepi/static/defaults/avatar_6.jpg rename to chapeau/bowler_pub/static/defaults/avatar_6.jpg diff --git a/chapeau/kepi/static/defaults/avatar_7.jpg b/chapeau/bowler_pub/static/defaults/avatar_7.jpg similarity index 100% rename from chapeau/kepi/static/defaults/avatar_7.jpg rename to chapeau/bowler_pub/static/defaults/avatar_7.jpg diff --git a/chapeau/kepi/static/defaults/avatar_8.jpg b/chapeau/bowler_pub/static/defaults/avatar_8.jpg similarity index 100% rename from chapeau/kepi/static/defaults/avatar_8.jpg rename to chapeau/bowler_pub/static/defaults/avatar_8.jpg diff --git a/chapeau/kepi/static/defaults/avatar_9.jpg b/chapeau/bowler_pub/static/defaults/avatar_9.jpg similarity index 100% rename from chapeau/kepi/static/defaults/avatar_9.jpg rename to chapeau/bowler_pub/static/defaults/avatar_9.jpg diff --git a/chapeau/kepi/static/defaults/avatar_fullsize.jpg b/chapeau/bowler_pub/static/defaults/avatar_fullsize.jpg similarity index 100% rename from chapeau/kepi/static/defaults/avatar_fullsize.jpg rename to chapeau/bowler_pub/static/defaults/avatar_fullsize.jpg diff --git a/chapeau/kepi/static/defaults/header.jpg b/chapeau/bowler_pub/static/defaults/header.jpg similarity index 100% rename from chapeau/kepi/static/defaults/header.jpg rename to chapeau/bowler_pub/static/defaults/header.jpg diff --git a/chapeau/kepi/static/testing/alice.jpg b/chapeau/bowler_pub/static/testing/alice.jpg similarity index 100% rename from chapeau/kepi/static/testing/alice.jpg rename to chapeau/bowler_pub/static/testing/alice.jpg diff --git a/chapeau/kepi/static/testing/bob.jpg b/chapeau/bowler_pub/static/testing/bob.jpg similarity index 100% rename from chapeau/kepi/static/testing/bob.jpg rename to chapeau/bowler_pub/static/testing/bob.jpg diff --git a/chapeau/kepi/static/testing/carol.jpg b/chapeau/bowler_pub/static/testing/carol.jpg similarity index 100% rename from chapeau/kepi/static/testing/carol.jpg rename to chapeau/bowler_pub/static/testing/carol.jpg diff --git a/chapeau/kepi/templates/host-meta.xml b/chapeau/bowler_pub/templates/host-meta.xml similarity index 100% rename from chapeau/kepi/templates/host-meta.xml rename to chapeau/bowler_pub/templates/host-meta.xml diff --git a/chapeau/kepi/tests/__init__.py b/chapeau/bowler_pub/tests/__init__.py similarity index 96% rename from chapeau/kepi/tests/__init__.py rename to chapeau/bowler_pub/tests/__init__.py index 1d3ddeb..d0631df 100644 --- a/chapeau/kepi/tests/__init__.py +++ b/chapeau/bowler_pub/tests/__init__.py @@ -1,7 +1,7 @@ -from chapeau.kepi.create import create -from chapeau.kepi.validation import IncomingMessage, validate -from chapeau.kepi.models import AcObject, AcActor -from chapeau.kepi.utils import as_json, uri_to_url, configured_url +from chapeau.bowler_pub.create import create +from chapeau.bowler_pub.validation import IncomingMessage, validate +from chapeau.bowler_pub.models import AcObject, AcActor +from chapeau.bowler_pub.utils import as_json, uri_to_url, configured_url from django.conf import settings import django.test import httpretty @@ -36,7 +36,7 @@ CONTEXT_URL = "https://www.w3.org/ns/activitystreams" logger = logging.getLogger(name='chapeau') def create_local_person(name='jemima', - load_default_keys_from='chapeau/kepi/tests/keys/keys-0003.json', + load_default_keys_from='chapeau/bowler_pub/tests/keys/keys-0003.json', **kwargs): if 'publicKey' or 'privateKey' not in kwargs: @@ -363,7 +363,7 @@ def remote_user(url, name, def remote_object_is_recorded(url): - from chapeau.kepi.models import AcObject + from chapeau.bowler_pub.models import AcObject try: result = AcObject.objects.get(id=url) diff --git a/chapeau/kepi/tests/keys/instances.pem b/chapeau/bowler_pub/tests/keys/instances.pem similarity index 100% rename from chapeau/kepi/tests/keys/instances.pem rename to chapeau/bowler_pub/tests/keys/instances.pem diff --git a/chapeau/kepi/tests/keys/keys-0000.json b/chapeau/bowler_pub/tests/keys/keys-0000.json similarity index 100% rename from chapeau/kepi/tests/keys/keys-0000.json rename to chapeau/bowler_pub/tests/keys/keys-0000.json diff --git a/chapeau/kepi/tests/keys/keys-0001.json b/chapeau/bowler_pub/tests/keys/keys-0001.json similarity index 100% rename from chapeau/kepi/tests/keys/keys-0001.json rename to chapeau/bowler_pub/tests/keys/keys-0001.json diff --git a/chapeau/kepi/tests/keys/keys-0002.json b/chapeau/bowler_pub/tests/keys/keys-0002.json similarity index 100% rename from chapeau/kepi/tests/keys/keys-0002.json rename to chapeau/bowler_pub/tests/keys/keys-0002.json diff --git a/chapeau/kepi/tests/keys/keys-0003.json b/chapeau/bowler_pub/tests/keys/keys-0003.json similarity index 100% rename from chapeau/kepi/tests/keys/keys-0003.json rename to chapeau/bowler_pub/tests/keys/keys-0003.json diff --git a/chapeau/kepi/tests/keys/marnanel.pem b/chapeau/bowler_pub/tests/keys/marnanel.pem similarity index 100% rename from chapeau/kepi/tests/keys/marnanel.pem rename to chapeau/bowler_pub/tests/keys/marnanel.pem diff --git a/chapeau/kepi/tests/manage/__init__.py b/chapeau/bowler_pub/tests/manage/__init__.py similarity index 100% rename from chapeau/kepi/tests/manage/__init__.py rename to chapeau/bowler_pub/tests/manage/__init__.py diff --git a/chapeau/kepi/tests/manage/test_kepi_post.py b/chapeau/bowler_pub/tests/manage/test_kepi_post.py similarity index 98% rename from chapeau/kepi/tests/manage/test_kepi_post.py rename to chapeau/bowler_pub/tests/manage/test_kepi_post.py index 028d3d1..d3bcc1b 100644 --- a/chapeau/kepi/tests/manage/test_kepi_post.py +++ b/chapeau/bowler_pub/tests/manage/test_kepi_post.py @@ -1,7 +1,7 @@ from io import StringIO from django.test import TestCase from django.core.management import call_command -from chapeau.kepi.models import * +from chapeau.bowler_pub.models import * from .. import create_local_person class KepiPostTest(TestCase): diff --git a/chapeau/kepi/tests/manage/test_kepi_users.py b/chapeau/bowler_pub/tests/manage/test_kepi_users.py similarity index 100% rename from chapeau/kepi/tests/manage/test_kepi_users.py rename to chapeau/bowler_pub/tests/manage/test_kepi_users.py diff --git a/chapeau/kepi/tests/mastodon/README.md b/chapeau/bowler_pub/tests/mastodon/README.md similarity index 100% rename from chapeau/kepi/tests/mastodon/README.md rename to chapeau/bowler_pub/tests/mastodon/README.md diff --git a/chapeau/kepi/tests/mastodon/__init__.py b/chapeau/bowler_pub/tests/mastodon/__init__.py similarity index 100% rename from chapeau/kepi/tests/mastodon/__init__.py rename to chapeau/bowler_pub/tests/mastodon/__init__.py diff --git a/chapeau/kepi/tests/mastodon/accept_spec.rb b/chapeau/bowler_pub/tests/mastodon/accept_spec.rb similarity index 100% rename from chapeau/kepi/tests/mastodon/accept_spec.rb rename to chapeau/bowler_pub/tests/mastodon/accept_spec.rb diff --git a/chapeau/kepi/tests/mastodon/add_spec.rb b/chapeau/bowler_pub/tests/mastodon/add_spec.rb similarity index 100% rename from chapeau/kepi/tests/mastodon/add_spec.rb rename to chapeau/bowler_pub/tests/mastodon/add_spec.rb diff --git a/chapeau/kepi/tests/mastodon/announce_spec.rb b/chapeau/bowler_pub/tests/mastodon/announce_spec.rb similarity index 100% rename from chapeau/kepi/tests/mastodon/announce_spec.rb rename to chapeau/bowler_pub/tests/mastodon/announce_spec.rb diff --git a/chapeau/kepi/tests/mastodon/block_spec.rb b/chapeau/bowler_pub/tests/mastodon/block_spec.rb similarity index 100% rename from chapeau/kepi/tests/mastodon/block_spec.rb rename to chapeau/bowler_pub/tests/mastodon/block_spec.rb diff --git a/chapeau/kepi/tests/mastodon/create_spec.rb b/chapeau/bowler_pub/tests/mastodon/create_spec.rb similarity index 100% rename from chapeau/kepi/tests/mastodon/create_spec.rb rename to chapeau/bowler_pub/tests/mastodon/create_spec.rb diff --git a/chapeau/kepi/tests/mastodon/delete_spec.rb b/chapeau/bowler_pub/tests/mastodon/delete_spec.rb similarity index 100% rename from chapeau/kepi/tests/mastodon/delete_spec.rb rename to chapeau/bowler_pub/tests/mastodon/delete_spec.rb diff --git a/chapeau/kepi/tests/mastodon/flag_spec.rb b/chapeau/bowler_pub/tests/mastodon/flag_spec.rb similarity index 100% rename from chapeau/kepi/tests/mastodon/flag_spec.rb rename to chapeau/bowler_pub/tests/mastodon/flag_spec.rb diff --git a/chapeau/kepi/tests/mastodon/follow_spec.rb b/chapeau/bowler_pub/tests/mastodon/follow_spec.rb similarity index 100% rename from chapeau/kepi/tests/mastodon/follow_spec.rb rename to chapeau/bowler_pub/tests/mastodon/follow_spec.rb diff --git a/chapeau/kepi/tests/mastodon/like_spec.rb b/chapeau/bowler_pub/tests/mastodon/like_spec.rb similarity index 100% rename from chapeau/kepi/tests/mastodon/like_spec.rb rename to chapeau/bowler_pub/tests/mastodon/like_spec.rb diff --git a/chapeau/kepi/tests/mastodon/move_spec.rb b/chapeau/bowler_pub/tests/mastodon/move_spec.rb similarity index 100% rename from chapeau/kepi/tests/mastodon/move_spec.rb rename to chapeau/bowler_pub/tests/mastodon/move_spec.rb diff --git a/chapeau/kepi/tests/mastodon/reject_spec.rb b/chapeau/bowler_pub/tests/mastodon/reject_spec.rb similarity index 100% rename from chapeau/kepi/tests/mastodon/reject_spec.rb rename to chapeau/bowler_pub/tests/mastodon/reject_spec.rb diff --git a/chapeau/kepi/tests/mastodon/remove_spec.rb b/chapeau/bowler_pub/tests/mastodon/remove_spec.rb similarity index 100% rename from chapeau/kepi/tests/mastodon/remove_spec.rb rename to chapeau/bowler_pub/tests/mastodon/remove_spec.rb diff --git a/chapeau/kepi/tests/mastodon/test_create.py b/chapeau/bowler_pub/tests/mastodon/test_create.py similarity index 96% rename from chapeau/kepi/tests/mastodon/test_create.py rename to chapeau/bowler_pub/tests/mastodon/test_create.py index 277a4a0..c48a7b0 100644 --- a/chapeau/kepi/tests/mastodon/test_create.py +++ b/chapeau/bowler_pub/tests/mastodon/test_create.py @@ -1,9 +1,9 @@ from django.test import TestCase -from chapeau.kepi.tests import create_local_note, create_local_person -from chapeau.kepi.create import create -from chapeau.kepi.models.audience import Audience, AUDIENCE_FIELD_NAMES -from chapeau.kepi.models.mention import Mention -from chapeau.kepi.models.item import AcItem +from chapeau.bowler_pub.tests import create_local_note, create_local_person +from chapeau.bowler_pub.create import create +from chapeau.bowler_pub.models.audience import Audience, AUDIENCE_FIELD_NAMES +from chapeau.bowler_pub.models.mention import Mention +from chapeau.bowler_pub.models.item import AcItem from .. import create_local_person import logging import json @@ -306,7 +306,7 @@ class TestCreate(TestCase): def test_when_sender_is_followed_by_local_users(self): - from chapeau.kepi.models.following import Following + from chapeau.bowler_pub.models.following import Following local_user = create_local_person() diff --git a/chapeau/kepi/tests/mastodon/test_like.py b/chapeau/bowler_pub/tests/mastodon/test_like.py similarity index 86% rename from chapeau/kepi/tests/mastodon/test_like.py rename to chapeau/bowler_pub/tests/mastodon/test_like.py index c18e197..93e2406 100644 --- a/chapeau/kepi/tests/mastodon/test_like.py +++ b/chapeau/bowler_pub/tests/mastodon/test_like.py @@ -1,6 +1,6 @@ -from chapeau.kepi.tests import create_local_note, create_local_person +from chapeau.bowler_pub.tests import create_local_note, create_local_person from unittest import skip -from chapeau.kepi.create import create +from chapeau.bowler_pub.create import create from django.test import TestCase class TestLike(TestCase): diff --git a/chapeau/kepi/tests/mastodon/test_update.py b/chapeau/bowler_pub/tests/mastodon/test_update.py similarity index 83% rename from chapeau/kepi/tests/mastodon/test_update.py rename to chapeau/bowler_pub/tests/mastodon/test_update.py index e02f972..f53a060 100644 --- a/chapeau/kepi/tests/mastodon/test_update.py +++ b/chapeau/bowler_pub/tests/mastodon/test_update.py @@ -1,8 +1,8 @@ from django.test import TestCase -from chapeau.kepi.tests import create_local_note, create_local_person +from chapeau.bowler_pub.tests import create_local_note, create_local_person from unittest import skip -from chapeau.kepi.create import create -from chapeau.kepi.models import * +from chapeau.bowler_pub.create import create +from chapeau.bowler_pub.models import * import logging SENDER_ID = 'https://example.com/actor' diff --git a/chapeau/kepi/tests/mastodon/undo_spec.rb b/chapeau/bowler_pub/tests/mastodon/undo_spec.rb similarity index 100% rename from chapeau/kepi/tests/mastodon/undo_spec.rb rename to chapeau/bowler_pub/tests/mastodon/undo_spec.rb diff --git a/chapeau/kepi/tests/mastodon/update_spec.rb b/chapeau/bowler_pub/tests/mastodon/update_spec.rb similarity index 100% rename from chapeau/kepi/tests/mastodon/update_spec.rb rename to chapeau/bowler_pub/tests/mastodon/update_spec.rb diff --git a/chapeau/kepi/tests/test_activity.py b/chapeau/bowler_pub/tests/test_activity.py similarity index 94% rename from chapeau/kepi/tests/test_activity.py rename to chapeau/bowler_pub/tests/test_activity.py index 255bb16..c53d2bb 100644 --- a/chapeau/kepi/tests/test_activity.py +++ b/chapeau/bowler_pub/tests/test_activity.py @@ -5,8 +5,8 @@ # Licensed under the GNU Public License v2. from django.test import TestCase -from chapeau.kepi.models import AcObject, AcActivity -from chapeau.kepi.create import create +from chapeau.bowler_pub.models import AcObject, AcActivity +from chapeau.bowler_pub.create import create from unittest import skip from . import remote_object_is_recorded, create_local_person import logging @@ -39,7 +39,7 @@ class TestAcObject(TestCase): def test_remote_no_id(self): - from chapeau.kepi.models import AcObject + from chapeau.bowler_pub.models import AcObject create( f_type = "Create", diff --git a/chapeau/kepi/tests/test_audience.py b/chapeau/bowler_pub/tests/test_audience.py similarity index 97% rename from chapeau/kepi/tests/test_audience.py rename to chapeau/bowler_pub/tests/test_audience.py index 897c5ad..2605b8a 100644 --- a/chapeau/kepi/tests/test_audience.py +++ b/chapeau/bowler_pub/tests/test_audience.py @@ -1,6 +1,6 @@ from django.test import TestCase -from chapeau.kepi.models import Audience -from chapeau.kepi.create import create +from chapeau.bowler_pub.models import Audience +from chapeau.bowler_pub.create import create from . import create_local_person, REMOTE_FRED, REMOTE_JIM class TestAudience(TestCase): diff --git a/chapeau/kepi/tests/test_collection.py b/chapeau/bowler_pub/tests/test_collection.py similarity index 98% rename from chapeau/kepi/tests/test_collection.py rename to chapeau/bowler_pub/tests/test_collection.py index bdf99ab..4f28921 100644 --- a/chapeau/kepi/tests/test_collection.py +++ b/chapeau/bowler_pub/tests/test_collection.py @@ -1,10 +1,10 @@ from django.test import TestCase, Client from unittest import skip -from chapeau.kepi.models import * +from chapeau.bowler_pub.models import * import datetime import json -from chapeau.kepi.find import find -from chapeau.kepi.utils import as_json +from chapeau.bowler_pub.find import find +from chapeau.bowler_pub.utils import as_json from . import * import logging diff --git a/chapeau/kepi/tests/test_deliver.py b/chapeau/bowler_pub/tests/test_deliver.py similarity index 92% rename from chapeau/kepi/tests/test_deliver.py rename to chapeau/bowler_pub/tests/test_deliver.py index 0b14505..6cf1806 100644 --- a/chapeau/kepi/tests/test_deliver.py +++ b/chapeau/bowler_pub/tests/test_deliver.py @@ -9,10 +9,10 @@ from django.test import TestCase, Client from django.conf import settings -from chapeau.kepi.delivery import deliver -from chapeau.kepi.create import create -from chapeau.kepi.models import AcObject -import chapeau.kepi.views as kepi_views +from chapeau.bowler_pub.delivery import deliver +from chapeau.bowler_pub.create import create +from chapeau.bowler_pub.models import AcObject +import chapeau.bowler_pub.views as bowler_pub_views from unittest.mock import Mock, patch from . import * import logging @@ -38,7 +38,7 @@ class TestDelivery(TestCase): def _set_up_remote_user_mocks(self): - keys = json.load(open('chapeau/kepi/tests/keys/keys-0001.json', 'r')) + keys = json.load(open('chapeau/bowler_pub/tests/keys/keys-0001.json', 'r')) create_remote_person( url = REMOTE_FRED, @@ -86,14 +86,14 @@ class TestDelivery(TestCase): def _set_up_local_user_mocks(self): - keys = json.load(open('chapeau/kepi/tests/keys/keys-0002.json', 'r')) + keys = json.load(open('chapeau/bowler_pub/tests/keys/keys-0002.json', 'r')) # I know these aren't mocks. This is just for consistency. create_local_person(name='alice', privateKey = keys['private']) create_local_person(name='bob') - @patch.object(kepi_views.activitypub.ActorView, 'activity_store') + @patch.object(bowler_pub_views.activitypub.ActorView, 'activity_store') @httpretty.activate def _test_delivery(self, fake_local_request, diff --git a/chapeau/kepi/tests/test_find.py b/chapeau/bowler_pub/tests/test_find.py similarity index 94% rename from chapeau/kepi/tests/test_find.py rename to chapeau/bowler_pub/tests/test_find.py index 3a95cc1..197426b 100644 --- a/chapeau/kepi/tests/test_find.py +++ b/chapeau/bowler_pub/tests/test_find.py @@ -1,12 +1,12 @@ from django.test import TestCase -from chapeau.kepi.find import find -from chapeau.kepi.create import create +from chapeau.bowler_pub.find import find +from chapeau.bowler_pub.create import create from django.conf import settings from . import * import httpretty import json import logging -from chapeau.kepi.utils import as_json +from chapeau.bowler_pub.utils import as_json logger = logging.getLogger(name='chapeau') diff --git a/chapeau/kepi/tests/test_headers.py b/chapeau/bowler_pub/tests/test_headers.py similarity index 100% rename from chapeau/kepi/tests/test_headers.py rename to chapeau/bowler_pub/tests/test_headers.py diff --git a/chapeau/kepi/tests/test_host_meta.py b/chapeau/bowler_pub/tests/test_host_meta.py similarity index 100% rename from chapeau/kepi/tests/test_host_meta.py rename to chapeau/bowler_pub/tests/test_host_meta.py diff --git a/chapeau/kepi/tests/test_hostinfo.py b/chapeau/bowler_pub/tests/test_hostinfo.py similarity index 100% rename from chapeau/kepi/tests/test_hostinfo.py rename to chapeau/bowler_pub/tests/test_hostinfo.py diff --git a/chapeau/kepi/tests/test_nodeinfo.py b/chapeau/bowler_pub/tests/test_nodeinfo.py similarity index 100% rename from chapeau/kepi/tests/test_nodeinfo.py rename to chapeau/bowler_pub/tests/test_nodeinfo.py diff --git a/chapeau/kepi/tests/test_polymorph.py b/chapeau/bowler_pub/tests/test_polymorph.py similarity index 90% rename from chapeau/kepi/tests/test_polymorph.py rename to chapeau/bowler_pub/tests/test_polymorph.py index 114ca7a..faef6a3 100644 --- a/chapeau/kepi/tests/test_polymorph.py +++ b/chapeau/bowler_pub/tests/test_polymorph.py @@ -1,7 +1,7 @@ from django.test import TestCase from unittest import skip -from chapeau.kepi.create import create -from chapeau.kepi.models import * +from chapeau.bowler_pub.create import create +from chapeau.bowler_pub.models import * import logging logger = logging.getLogger(name='chapeau') diff --git a/chapeau/kepi/tests/test_read_from_outbox.py b/chapeau/bowler_pub/tests/test_read_from_outbox.py similarity index 98% rename from chapeau/kepi/tests/test_read_from_outbox.py rename to chapeau/bowler_pub/tests/test_read_from_outbox.py index eeb7d0c..b3e6346 100644 --- a/chapeau/kepi/tests/test_read_from_outbox.py +++ b/chapeau/bowler_pub/tests/test_read_from_outbox.py @@ -1,6 +1,6 @@ from django.conf import settings from django.test import TestCase, Client -from chapeau.kepi.create import create +from chapeau.bowler_pub.create import create from . import create_local_person import httpretty import logging @@ -126,7 +126,7 @@ class TestOutbox(TestCase): what): if not hasattr(self, '_example_user'): - keys = json.load(open('chapeau/kepi/tests/keys/keys-0001.json', 'r')) + keys = json.load(open('chapeau/bowler_pub/tests/keys/keys-0001.json', 'r')) alice = create_local_person( name='alice', diff --git a/chapeau/kepi/tests/test_send_to_inbox.py b/chapeau/bowler_pub/tests/test_send_to_inbox.py similarity index 90% rename from chapeau/kepi/tests/test_send_to_inbox.py rename to chapeau/bowler_pub/tests/test_send_to_inbox.py index e646982..882519a 100644 --- a/chapeau/kepi/tests/test_send_to_inbox.py +++ b/chapeau/bowler_pub/tests/test_send_to_inbox.py @@ -1,11 +1,11 @@ from django.test import TestCase from unittest import skip -from chapeau.kepi.tests import * -from chapeau.kepi.create import create -from chapeau.kepi.models.audience import Audience, AUDIENCE_FIELD_NAMES -from chapeau.kepi.models.mention import Mention -from chapeau.kepi.models.item import AcItem -from chapeau.kepi.models.following import Following +from chapeau.bowler_pub.tests import * +from chapeau.bowler_pub.create import create +from chapeau.bowler_pub.models.audience import Audience, AUDIENCE_FIELD_NAMES +from chapeau.bowler_pub.models.mention import Mention +from chapeau.bowler_pub.models.item import AcItem +from chapeau.bowler_pub.models.following import Following from django.test import Client from urllib.parse import urlparse import httpretty @@ -65,7 +65,7 @@ class TestInbox2(TestCase): ] if recipientKeys is None: - recipientKeys = json.load(open('chapeau/kepi/tests/keys/keys-0001.json', 'r')) + recipientKeys = json.load(open('chapeau/bowler_pub/tests/keys/keys-0001.json', 'r')) if recipient is None: recipient = create_local_person( @@ -75,7 +75,7 @@ class TestInbox2(TestCase): ) if senderKeys is None: - senderKeys = json.load(open('chapeau/kepi/tests/keys/keys-0002.json', 'r')) + senderKeys = json.load(open('chapeau/bowler_pub/tests/keys/keys-0002.json', 'r')) if sender is None: sender = create_remote_person( @@ -163,7 +163,7 @@ class TestInbox2(TestCase): @httpretty.activate def test_sole_inbox(self): - recipientKeys = json.load(open('chapeau/kepi/tests/keys/keys-0001.json', 'r')) + recipientKeys = json.load(open('chapeau/bowler_pub/tests/keys/keys-0001.json', 'r')) recipient = create_local_person( name = 'alice', publicKey = recipientKeys['public'], @@ -192,7 +192,7 @@ class TestInbox2(TestCase): @httpretty.activate def test_shared_inbox(self): - recipientKeys = json.load(open('chapeau/kepi/tests/keys/keys-0001.json', 'r')) + recipientKeys = json.load(open('chapeau/bowler_pub/tests/keys/keys-0001.json', 'r')) recipient = create_local_person( name = 'alice', publicKey = recipientKeys['public'], diff --git a/chapeau/kepi/tests/test_send_to_outbox.py b/chapeau/bowler_pub/tests/test_send_to_outbox.py similarity index 92% rename from chapeau/kepi/tests/test_send_to_outbox.py rename to chapeau/bowler_pub/tests/test_send_to_outbox.py index e0c6f38..ff1b0b2 100644 --- a/chapeau/kepi/tests/test_send_to_outbox.py +++ b/chapeau/bowler_pub/tests/test_send_to_outbox.py @@ -1,12 +1,12 @@ from django.test import TestCase from unittest import skip -from chapeau.kepi.tests import * -from chapeau.kepi.create import create -from chapeau.kepi.models.audience import Audience, AUDIENCE_FIELD_NAMES -from chapeau.kepi.models.mention import Mention -from chapeau.kepi.models.item import AcItem -from chapeau.kepi.models.acobject import AcObject -from chapeau.kepi.models.activity import AcActivity +from chapeau.bowler_pub.tests import * +from chapeau.bowler_pub.create import create +from chapeau.bowler_pub.models.audience import Audience, AUDIENCE_FIELD_NAMES +from chapeau.bowler_pub.models.mention import Mention +from chapeau.bowler_pub.models.item import AcItem +from chapeau.bowler_pub.models.acobject import AcObject +from chapeau.bowler_pub.models.activity import AcActivity from django.test import Client from urllib.parse import urlparse import httpretty @@ -63,7 +63,7 @@ class TestOutbox(TestCase): ): if keys is None: - keys = json.load(open('chapeau/kepi/tests/keys/keys-0001.json', 'r')) + keys = json.load(open('chapeau/bowler_pub/tests/keys/keys-0001.json', 'r')) if sender is None: sender = create_local_person( @@ -163,7 +163,7 @@ class TestOutbox(TestCase): def test_post_by_remote_interloper(self): - keys = json.load(open('chapeau/kepi/tests/keys/keys-0002.json', 'r')) + keys = json.load(open('chapeau/bowler_pub/tests/keys/keys-0002.json', 'r')) sender = create_remote_person( url = REMOTE_DAVE_ID, @@ -190,8 +190,8 @@ class TestOutbox(TestCase): def test_post_by_local_interloper(self): - keys1 = json.load(open('chapeau/kepi/tests/keys/keys-0001.json', 'r')) - keys2 = json.load(open('chapeau/kepi/tests/keys/keys-0002.json', 'r')) + keys1 = json.load(open('chapeau/bowler_pub/tests/keys/keys-0001.json', 'r')) + keys2 = json.load(open('chapeau/bowler_pub/tests/keys/keys-0002.json', 'r')) create_local_person( name = 'alice', @@ -344,7 +344,7 @@ class TestOutbox(TestCase): c = Client() - keys = json.load(open('chapeau/kepi/tests/keys/keys-0001.json', 'r')) + keys = json.load(open('chapeau/bowler_pub/tests/keys/keys-0001.json', 'r')) alice = create_local_person( name = 'alice', diff --git a/chapeau/kepi/tests/test_validation.py b/chapeau/bowler_pub/tests/test_validation.py similarity index 90% rename from chapeau/kepi/tests/test_validation.py rename to chapeau/bowler_pub/tests/test_validation.py index 72198d8..98771ad 100644 --- a/chapeau/kepi/tests/test_validation.py +++ b/chapeau/bowler_pub/tests/test_validation.py @@ -1,6 +1,6 @@ from django.test import TestCase, Client -from chapeau.kepi.validation import IncomingMessage, validate -from chapeau.kepi.models import AcObject +from chapeau.bowler_pub.validation import IncomingMessage, validate +from chapeau.bowler_pub.models import AcObject from unittest import skip import httpretty from . import * @@ -37,7 +37,7 @@ class TestValidationTasks(TestCase): @httpretty.activate def test_local_lookup(self): - keys = json.load(open('chapeau/kepi/tests/keys/keys-0001.json', 'r')) + keys = json.load(open('chapeau/bowler_pub/tests/keys/keys-0001.json', 'r')) alice = create_local_person( name = 'alice', @@ -67,7 +67,7 @@ class TestValidationTasks(TestCase): @httpretty.activate def test_remote_user_known(self): - keys = json.load(open('chapeau/kepi/tests/keys/keys-0001.json', 'r')) + keys = json.load(open('chapeau/bowler_pub/tests/keys/keys-0001.json', 'r')) fetched = { 'fred': False, } @@ -108,8 +108,8 @@ class TestValidationTasks(TestCase): @httpretty.activate def test_remote_user_spoofed(self): - keys1 = json.load(open('chapeau/kepi/tests/keys/keys-0001.json', 'r')) - keys2 = json.load(open('chapeau/kepi/tests/keys/keys-0002.json', 'r')) + keys1 = json.load(open('chapeau/bowler_pub/tests/keys/keys-0001.json', 'r')) + keys2 = json.load(open('chapeau/bowler_pub/tests/keys/keys-0002.json', 'r')) fetched = { 'fred': False, @@ -153,7 +153,7 @@ class TestValidationTasks(TestCase): @httpretty.activate def test_remote_user_gone(self): - keys = json.load(open('chapeau/kepi/tests/keys/keys-0001.json', 'r')) + keys = json.load(open('chapeau/bowler_pub/tests/keys/keys-0001.json', 'r')) fetched = { 'fred': False, } @@ -190,7 +190,7 @@ class TestValidationTasks(TestCase): @httpretty.activate def test_remote_user_unknown(self): - keys = json.load(open('chapeau/kepi/tests/keys/keys-0001.json', 'r')) + keys = json.load(open('chapeau/bowler_pub/tests/keys/keys-0001.json', 'r')) fetched = { 'fred': False, } diff --git a/chapeau/kepi/tests/test_views.py b/chapeau/bowler_pub/tests/test_views.py similarity index 97% rename from chapeau/kepi/tests/test_views.py rename to chapeau/bowler_pub/tests/test_views.py index d213035..42b51b8 100644 --- a/chapeau/kepi/tests/test_views.py +++ b/chapeau/bowler_pub/tests/test_views.py @@ -25,7 +25,7 @@ class TestKepiView(TestCase): settings.KEPI['LOCAL_OBJECT_HOSTNAME'] = 'testserver' self.maxDiff = None - def test_single_kepi_view(self): + def test_single_bowler_pub_view(self): alice = create_local_person('alice', summary = ALICE_SUMMARY, @@ -54,7 +54,7 @@ class TestKepiView(TestCase): ALICE_SUMMARY, ) - def test_multiple_kepi_view(self): + def test_multiple_bowler_pub_view(self): alice = create_local_person('alice') bob = create_local_person('bob') diff --git a/chapeau/kepi/tests/test_webfinger.py b/chapeau/bowler_pub/tests/test_webfinger.py similarity index 97% rename from chapeau/kepi/tests/test_webfinger.py rename to chapeau/bowler_pub/tests/test_webfinger.py index 44b3040..36cc04d 100644 --- a/chapeau/kepi/tests/test_webfinger.py +++ b/chapeau/bowler_pub/tests/test_webfinger.py @@ -13,7 +13,7 @@ logger = logging.getLogger(name='chapeau') class TestWebfinger(TestCase): def setUp(self): - keys = json.load(open('chapeau/kepi/tests/keys/keys-0001.json', 'r')) + keys = json.load(open('chapeau/bowler_pub/tests/keys/keys-0001.json', 'r')) create_local_person( name='alice', diff --git a/chapeau/kepi/tests/verify-examples.py b/chapeau/bowler_pub/tests/verify-examples.py similarity index 100% rename from chapeau/kepi/tests/verify-examples.py rename to chapeau/bowler_pub/tests/verify-examples.py diff --git a/chapeau/bowler_pub/urls.py b/chapeau/bowler_pub/urls.py new file mode 100644 index 0000000..1450f6c --- /dev/null +++ b/chapeau/bowler_pub/urls.py @@ -0,0 +1,34 @@ +# urls.py +# +# Part of an ActivityPub daemon. +# Copyright (c) 2018-2019 Marnanel Thurman. +# Licensed under the GNU Public License v2. + +""" +These are URL patterns, to include from your app's urls.py. +""" + +from django.urls import path, re_path +import chapeau.bowler_pub.views as bowler_pub_views + +urlpatterns = [ + re_path('^(?P[0-9a-z]{8})$', bowler_pub_views.ThingView.as_view()), + path('users', bowler_pub_views.AllUsersView.as_view()), + path('users/', bowler_pub_views.ActorView.as_view()), + path('users//inbox', bowler_pub_views.InboxView.as_view(), + { 'listname': 'inbox', } ), + path('users//outbox', bowler_pub_views.OutboxView.as_view(), + { 'listname': 'outbox', } ), + path('users//followers', bowler_pub_views.FollowersView.as_view()), + path('users//following', bowler_pub_views.FollowingView.as_view()), + path('sharedInbox', bowler_pub_views.InboxView.as_view()), + + # XXX We might want to split out the patterns that HAVE to be + # at the root. + + path('.well-known/host-meta', bowler_pub_views.HostMeta.as_view()), + path('.well-known/webfinger', bowler_pub_views.Webfinger.as_view()), + path('.well-known/nodeinfo', bowler_pub_views.NodeinfoPart1.as_view()), + path('nodeinfo.json', bowler_pub_views.NodeinfoPart2.as_view()), + ] + diff --git a/chapeau/kepi/utils.py b/chapeau/bowler_pub/utils.py similarity index 100% rename from chapeau/kepi/utils.py rename to chapeau/bowler_pub/utils.py diff --git a/chapeau/kepi/validation.py b/chapeau/bowler_pub/validation.py similarity index 97% rename from chapeau/kepi/validation.py rename to chapeau/bowler_pub/validation.py index e404deb..662071e 100644 --- a/chapeau/kepi/validation.py +++ b/chapeau/bowler_pub/validation.py @@ -29,7 +29,7 @@ class IncomingMessage(models.Model): At present, we don't delete them afterwards. This is so we can use them for forensics when stuff goes wrong. - But eventually we'll need kepi to clear up after itself. + But eventually we'll need bowler_pub to clear up after itself. The primary key is a UUID because it helps with logging. You can't use any of the fields from the message to identify it, @@ -156,9 +156,9 @@ def _run_validation( that was generated by validate(). """ - from chapeau.kepi.delivery import deliver - from chapeau.kepi.create import create - from chapeau.kepi.find import find + from chapeau.bowler_pub.delivery import deliver + from chapeau.bowler_pub.create import create + from chapeau.bowler_pub.find import find logger.info('%s: begin validation', message_id) diff --git a/chapeau/kepi/views/README.md b/chapeau/bowler_pub/views/README.md similarity index 92% rename from chapeau/kepi/views/README.md rename to chapeau/bowler_pub/views/README.md index 435e213..d8e6b6d 100644 --- a/chapeau/kepi/views/README.md +++ b/chapeau/bowler_pub/views/README.md @@ -22,4 +22,4 @@ ACTIVITY_STORE passes another object to the object represented by the URL. For example, passing a "Like" object to ``https://yourserver/users/alice/inbox`` would add the "Like" to Alice's inbox. -kepi.find() makes extensive use of the ACTIVITY methods. +bowler_pub.find() makes extensive use of the ACTIVITY methods. diff --git a/chapeau/kepi/views/__init__.py b/chapeau/bowler_pub/views/__init__.py similarity index 100% rename from chapeau/kepi/views/__init__.py rename to chapeau/bowler_pub/views/__init__.py diff --git a/chapeau/kepi/views/activitypub.py b/chapeau/bowler_pub/views/activitypub.py similarity index 97% rename from chapeau/kepi/views/activitypub.py rename to chapeau/bowler_pub/views/activitypub.py index a18af2a..f3d8f05 100644 --- a/chapeau/kepi/views/activitypub.py +++ b/chapeau/bowler_pub/views/activitypub.py @@ -13,18 +13,18 @@ Everything ends up here if it doesn't have a particular place to go. """ -from chapeau.kepi import ATSIGN_CONTEXT -import chapeau.kepi.validation -from chapeau.kepi.find import find, is_local -from chapeau.kepi.utils import configured_url, short_id_to_url, uri_to_url +from chapeau.bowler_pub import ATSIGN_CONTEXT +import chapeau.bowler_pub.validation +from chapeau.bowler_pub.find import find, is_local +from chapeau.bowler_pub.utils import configured_url, short_id_to_url, uri_to_url from django.shortcuts import render, get_object_or_404 import django.views from django.http import HttpResponse, JsonResponse, Http404 from django.contrib.auth.decorators import login_required from django.core.exceptions import ValidationError from django.conf import settings -from chapeau.kepi.models import * -from chapeau.kepi.validation import validate +from chapeau.bowler_pub.models import * +from chapeau.bowler_pub.validation import validate from collections.abc import Iterable import logging import urllib.parse @@ -337,7 +337,7 @@ class ActorView(ThingView): def activity_store(self, request, *args, **kwargs): - from chapeau.kepi.models.collection import Collection + from chapeau.bowler_pub.models.collection import Collection user = AcActor.objects.get( id='@'+kwargs['username'], @@ -468,7 +468,7 @@ class UserCollectionView(KepiView): listname, *args, **kwargs): - from chapeau.kepi.models.collection import Collection, CollectionMember + from chapeau.bowler_pub.models.collection import Collection, CollectionMember logger.debug('Finding user %s\'s %s collection', username, listname) @@ -500,7 +500,7 @@ class UserCollectionView(KepiView): listname, *args, **kwargs): - from chapeau.kepi.models.collection import Collection, CollectionMember + from chapeau.bowler_pub.models.collection import Collection, CollectionMember logger.debug('Finding user %s\'s %s collection', username, listname) @@ -572,7 +572,7 @@ class InboxView(UserCollectionView): def activity_store(self, request, username=None, *args, **kwargs): - from chapeau.kepi.delivery import deliver + from chapeau.bowler_pub.delivery import deliver if username is None: logger.info(' -- storing into the shared inbox') diff --git a/chapeau/kepi/views/host_meta.py b/chapeau/bowler_pub/views/host_meta.py similarity index 100% rename from chapeau/kepi/views/host_meta.py rename to chapeau/bowler_pub/views/host_meta.py diff --git a/chapeau/kepi/views/nodeinfo.py b/chapeau/bowler_pub/views/nodeinfo.py similarity index 98% rename from chapeau/kepi/views/nodeinfo.py rename to chapeau/bowler_pub/views/nodeinfo.py index ff33d59..d2294c5 100644 --- a/chapeau/kepi/views/nodeinfo.py +++ b/chapeau/bowler_pub/views/nodeinfo.py @@ -17,7 +17,7 @@ from django.http import HttpResponse from chapeau import __version__ import logging import re -from chapeau.kepi.utils import as_json +from chapeau.bowler_pub.utils import as_json logger = logging.Logger('chapeau') diff --git a/chapeau/kepi/views/webfinger.py b/chapeau/bowler_pub/views/webfinger.py similarity index 97% rename from chapeau/kepi/views/webfinger.py rename to chapeau/bowler_pub/views/webfinger.py index d860562..042439d 100644 --- a/chapeau/kepi/views/webfinger.py +++ b/chapeau/bowler_pub/views/webfinger.py @@ -13,12 +13,12 @@ for the full details. import django.views from django.conf import settings from django.shortcuts import render -from chapeau.kepi.models.actor import AcActor +from chapeau.bowler_pub.models.actor import AcActor from django.http import HttpResponse import logging import re import json -from chapeau.kepi.utils import as_json, configured_url +from chapeau.bowler_pub.utils import as_json, configured_url logger = logging.Logger('chapeau') diff --git a/chapeau/chapeau/settings.py b/chapeau/chapeau/settings.py index 2cf51f3..d2613f8 100644 --- a/chapeau/chapeau/settings.py +++ b/chapeau/chapeau/settings.py @@ -90,7 +90,7 @@ INSTALLED_APPS = ( 'django_fields', 'polymorphic', - 'chapeau.kepi', + 'chapeau.bowler_pub', 'chapeau.trilby_api', ) diff --git a/chapeau/chapeau/urls.py b/chapeau/chapeau/urls.py index d266330..5fbc28d 100644 --- a/chapeau/chapeau/urls.py +++ b/chapeau/chapeau/urls.py @@ -3,7 +3,7 @@ from django.urls import path, re_path, include from django.conf.urls.static import static from django.contrib.auth import views as auth_views import oauth2_provider.views as oauth2_views -import chapeau.kepi.urls +import chapeau.bowler_pub.urls import chapeau.trilby_api.urls from chapeau.trilby_api.views import fix_oauth2_redirects from . import settings @@ -31,7 +31,7 @@ urlpatterns = [ # chapeau's own stuff # path('', chapeau.tophat_ui.views.FrontPageView.as_view()), # or something - path(r'', include(chapeau.kepi.urls)), + path(r'', include(chapeau.bowler_pub.urls)), path(r'', include(chapeau.trilby_api.urls)), ] diff --git a/chapeau/kepi/urls.py b/chapeau/kepi/urls.py deleted file mode 100644 index aa192c7..0000000 --- a/chapeau/kepi/urls.py +++ /dev/null @@ -1,34 +0,0 @@ -# urls.py -# -# Part of an ActivityPub daemon. -# Copyright (c) 2018-2019 Marnanel Thurman. -# Licensed under the GNU Public License v2. - -""" -These are URL patterns, to include from your app's urls.py. -""" - -from django.urls import path, re_path -import chapeau.kepi.views as kepi_views - -urlpatterns = [ - re_path('^(?P[0-9a-z]{8})$', kepi_views.ThingView.as_view()), - path('users', kepi_views.AllUsersView.as_view()), - path('users/', kepi_views.ActorView.as_view()), - path('users//inbox', kepi_views.InboxView.as_view(), - { 'listname': 'inbox', } ), - path('users//outbox', kepi_views.OutboxView.as_view(), - { 'listname': 'outbox', } ), - path('users//followers', kepi_views.FollowersView.as_view()), - path('users//following', kepi_views.FollowingView.as_view()), - path('sharedInbox', kepi_views.InboxView.as_view()), - - # XXX We might want to split out the patterns that HAVE to be - # at the root. - - path('.well-known/host-meta', kepi_views.HostMeta.as_view()), - path('.well-known/webfinger', kepi_views.Webfinger.as_view()), - path('.well-known/nodeinfo', kepi_views.NodeinfoPart1.as_view()), - path('nodeinfo.json', kepi_views.NodeinfoPart2.as_view()), - ] - diff --git a/chapeau/trilby_api/admin.py b/chapeau/trilby_api/admin.py index 908152f..79b2fcc 100644 --- a/chapeau/trilby_api/admin.py +++ b/chapeau/trilby_api/admin.py @@ -3,7 +3,7 @@ from django.contrib.auth.admin import UserAdmin from django.contrib.auth.forms import UserChangeForm, UserCreationForm import chapeau.trilby_api.forms as trilby_forms import chapeau.trilby_api.models as trilby_models -from chapeau.kepi.create import create +from chapeau.bowler_pub.create import create @admin.register(trilby_models.TrilbyUser) class TrilbyUserAdmin(UserAdmin): diff --git a/chapeau/trilby_api/fixtures/alicebobcarol.json b/chapeau/trilby_api/fixtures/alicebobcarol.json index 4ba5b9a..1db0830 100644 --- a/chapeau/trilby_api/fixtures/alicebobcarol.json +++ b/chapeau/trilby_api/fixtures/alicebobcarol.json @@ -20,7 +20,7 @@ } }, { - "model": "kepi.acobject", + "model": "bowler_pub.acobject", "pk": "@alice", "fields": { "polymorphic_ctype": 48, @@ -29,7 +29,7 @@ } }, { - "model": "kepi.acactor", + "model": "bowler_pub.acactor", "pk": "@alice", "fields": { "privateKey": "-----BEGIN RSA PRIVATE KEY-----\nMIICWwIBAAKBgQDeDxrtPQDgoEpORMOX73vqXxyRbSDO/tdYMiJX4Eia1IJ/CW+l\nSc+NaM2ybjX7sFSqsrbtqUCT2eWcmCdYtkHZA0BRc+2q2c3WYJMoFxpxBB46Ep7o\nbDhal8Mhj4lOd7Wo4HYl1ehslE0PTLJgT6UR6ia5mtjFCowZEb2Kc8IGswIDAQAB\nAoGABK/QQ1gHtwtSJisyfTEBkcIDCgOeZ/x6h710eo2q9xNkfiaUuThA0U6xFEnL\n3v9Ha/isjNZ44+X7HIxyA7U0LW9N9ukUbFqnbBGaomqKDOKLOvqMvesXmhYj1zIS\njNCorHhxvpRFvgph6H+r8wBjIPbbByDB3PD0BDSkhEUkkLECQQDgO5X6kfHMYSM8\nA7tQG5izus1UQbhBXNZt2FfBhBjGiAEY3Oja3LDeUjId4Jdp3gK0ZbkR0O/x1REw\ngC3ZKwJLAkEA/YSup5C3zecrAUQN8hKhlhlmnXjsqpDbVzuf5BynIAJyf1Fc7w8r\n0p1Hc99VzQPdDrmfaR35TW2WmD+EO1kMOQJARKwa/5VIz0YEi3G9IQiCmLCiB6bk\n7ieniBaUsbBqAgtPArVNHxItnLjhnmLVHFggzezFZB5wDckqLYdkAzl3xwJAdwg8\nRRry4i9/Bqogbh+HVQV6I8fqPy+ifPPW3/EAG0xq3BKksu4JomsMaIBdNdRxj39i\nNKXJLyycP8Ha4U6vKQJAMMKBjGfJRSexAcAaNcP2Zwj4eMpT+QIrfVeYvfHeUT2T\njlbyBTMWuUDFGMjC7zfiRU2IOGoBoHKNR2nC2SWwEw==\n-----END RSA PRIVATE KEY-----", @@ -42,7 +42,7 @@ } }, { - "model": "kepi.acperson", + "model": "bowler_pub.acperson", "pk": "@alice", "fields": {} }, @@ -70,7 +70,7 @@ } }, { - "model": "kepi.acobject", + "model": "bowler_pub.acobject", "pk": "@bob", "fields": { "polymorphic_ctype": 48, @@ -79,7 +79,7 @@ } }, { - "model": "kepi.acactor", + "model": "bowler_pub.acactor", "pk": "@bob", "fields": { "privateKey": "-----BEGIN RSA PRIVATE KEY-----\nMIICXAIBAAKBgQCZcj4cSNiugpeilwBg9ymKu6FQPKM86f1aGSdLGDkT5ABLrAea\n/FwkZGpwh0p/p9liIZmpEDPE2t05wXU7wLGQXCowmVzoM4WmEa+ZuvC5d17OR8JC\nn+okvPqzYiUDqv1jgVqERCtvHY5847yvD/b7F2cs6momttmqdt2CYdXF8wIDAQAB\nAoGAEUjmKDIoflfllCy69TFCSQdjtMcaguUUuI52zPsN4D4MWSR9YtRPM3uVkIFy\nPzj9ar7AMWQgK2pABfPTLIeYjgQRFi9iyA4mD6xJxGIAf2a590PIUMjvR/udLvkL\nX2bCwND1BT4ltCm5HfhM0hQ5DPR1mrTGMIZoYBAXnz4nMbECQQDDgDRv4uVo878t\nY2jIq0vIge6T+18yFur8/yANWVy1jR2VD9XkV8jXDwzujTYc5aUngOlUxNLO7J2a\n+r1bdHZLAkEAyO5t7wX0GiCbBGHOfmUk7wa9xfxLhZafumrBBD1SHDDi0EQ5ZtVc\nbrPJp1eL3sncBFENlCiGaQKdY71XUzXF+QJANtBQY3qDheypkolHzNOyWNKNWPJm\n231vf2Xsz7FZfBHH1I5vEynFxv6SSqRPIsUEjFHpmfnhfWD8Q4K/6s95hwJARrvg\nyXdAEn6N88H2rnouwVKPNgZ2E6YNvtNb9YEcyb3P6t9JkdDkhDgYcieYnqpTINXj\nwNdvUcJQ487A0hMpCQJBAJXhIoabiEv+vAGn/zkLI7+PSuujlE9JdPxjHWMSTHGy\na9N3F3pfSDMpRPOAVm/WtxXln+hGuZNZMUOu/2lkDEg=\n-----END RSA PRIVATE KEY-----", @@ -92,7 +92,7 @@ } }, { - "model": "kepi.acperson", + "model": "bowler_pub.acperson", "pk": "@bob", "fields": {} }, @@ -120,7 +120,7 @@ } }, { - "model": "kepi.acobject", + "model": "bowler_pub.acobject", "pk": "@carol", "fields": { "polymorphic_ctype": 48, @@ -129,7 +129,7 @@ } }, { - "model": "kepi.acactor", + "model": "bowler_pub.acactor", "pk": "@carol", "fields": { "privateKey": "-----BEGIN RSA PRIVATE KEY-----\nMIICXAIBAAKBgQCVJ9rTVMvmQfE5gugY6CdLdubdluoBf9/mlPBDFKSj8rFRTDSx\nmF7GnkhLN/NuaDu5xzLEynIxEmTq3wYNSj0voF+U/foo2rnd85exx7qbacmGagYX\nbDrCbvz67m2p4GyQgksGy/9OjHlshwAOkswabUfhF6BVedwzz+EemqyZ9QIDAQAB\nAoGACq2OfyQaL8sHPa6HNqdCDuc9el4gNQjGSu/dLnQ3ICyS8KbDu/YUTOROeSIR\niZUpN3DRC+ERYT13n4/lU0S+EgN8YgBnsX+7VsTqyakK0s+Zza7RvLNL1bwCkSao\nY3lowJdZ9FeTXEsA6AXE129Z+eUP3ly5BxxZ3tETHFzUw/kCQQC12Dxdxj4Tp/PY\niskMwsqkLEv+2WtpFKBmJ1ozibjrZHu4XrB09b7PROr/YYa0WP8738mL929LyooZ\nf9fwIHQ5AkEA0fsJMUAMlYHvHI+8QaVrH6Nn3Rg1m13XSlzlgliv4xvOV1YqvegN\nhCXQMAm804cvmQlKmUQMA1G5s9++rr3rnQJANkJOSODVNwI/VVacBO2+j1wUVPfE\n//bCoZiOZqBqh/pUnD/MwSluhOQYhpkwG3IOvmvY9KWhFOlbaZ5m7WSRqQJAJgqF\nus9wuDFHAXSk1XvDcYLoES0OoSwaEdXMmpW4n7ts4XOx4J/GuxcipWFOPUAzhlUh\nl6y1RHCs5QJ3CC9OHQJBAJiYAsgJdHBOX1O6/N4yoGkp4U4ugSoN11DAPdLBzI7w\npaVg5SyP6nO9KMvq9CsTTJohidLqdokLgIuksF04yGg=\n-----END RSA PRIVATE KEY-----", @@ -142,7 +142,7 @@ } }, { - "model": "kepi.acperson", + "model": "bowler_pub.acperson", "pk": "@carol", "fields": {} }, @@ -150,7 +150,7 @@ { - "model": "kepi.acobject", + "model": "bowler_pub.acobject", "pk": "/a9d7569f", "fields": { "polymorphic_ctype": 45, @@ -159,7 +159,7 @@ } }, { - "model": "kepi.acitem", + "model": "bowler_pub.acitem", "pk": "/a9d7569f", "fields": { "f_content": "What's down the rabbit hole?", @@ -167,7 +167,7 @@ } }, { - "model": "kepi.acnote", + "model": "bowler_pub.acnote", "pk": "/a9d7569f", "fields": { "acitem_ptr": "/a9d7569f" @@ -177,7 +177,7 @@ { - "model": "kepi.acobject", + "model": "bowler_pub.acobject", "pk": "/a9d7569e", "fields": { "polymorphic_ctype": 45, @@ -186,7 +186,7 @@ } }, { - "model": "kepi.acitem", + "model": "bowler_pub.acitem", "pk": "/a9d7569e", "fields": { "f_content": "some pretty weird stuff tbh", @@ -194,7 +194,7 @@ } }, { - "model": "kepi.acnote", + "model": "bowler_pub.acnote", "pk": "/a9d7569e", "fields": { "acitem_ptr": "/a9d7569e" @@ -203,7 +203,7 @@ { - "model": "kepi.acobject", + "model": "bowler_pub.acobject", "pk": "/a9d7569d", "fields": { "polymorphic_ctype": 45, @@ -212,7 +212,7 @@ } }, { - "model": "kepi.acitem", + "model": "bowler_pub.acitem", "pk": "/a9d7569d", "fields": { "f_content": "@bob Do you know anything about playing cards?", @@ -220,7 +220,7 @@ } }, { - "model": "kepi.acnote", + "model": "bowler_pub.acnote", "pk": "/a9d7569d", "fields": { "acitem_ptr": "/a9d7569d" @@ -231,7 +231,7 @@ { - "model": "kepi.acobject", + "model": "bowler_pub.acobject", "pk": "/a9d7569c", "fields": { "polymorphic_ctype": 45, @@ -240,7 +240,7 @@ } }, { - "model": "kepi.acitem", + "model": "bowler_pub.acitem", "pk": "/a9d7569c", "fields": { "f_content": "@bob er, asking for a friend?", @@ -248,7 +248,7 @@ } }, { - "model": "kepi.acnote", + "model": "bowler_pub.acnote", "pk": "/a9d7569c", "fields": { "acitem_ptr": "/a9d7569c" @@ -257,7 +257,7 @@ { - "model": "kepi.acobject", + "model": "bowler_pub.acobject", "pk": "/a9d7569b", "fields": { "polymorphic_ctype": 45, @@ -266,7 +266,7 @@ } }, { - "model": "kepi.acitem", + "model": "bowler_pub.acitem", "pk": "/a9d7569b", "fields": { "f_content": "This is a private status.", @@ -274,7 +274,7 @@ } }, { - "model": "kepi.acnote", + "model": "bowler_pub.acnote", "pk": "/a9d7569b", "fields": { "acitem_ptr": "/a9d7569b" @@ -283,7 +283,7 @@ { - "model": "kepi.acobject", + "model": "bowler_pub.acobject", "pk": "/a9d7569a", "fields": { "polymorphic_ctype": 45, @@ -292,7 +292,7 @@ } }, { - "model": "kepi.acitem", + "model": "bowler_pub.acitem", "pk": "/a9d7569a", "fields": { "f_content": "he comes back three days later", @@ -300,7 +300,7 @@ } }, { - "model": "kepi.acnote", + "model": "bowler_pub.acnote", "pk": "/a9d7569a", "fields": { "acitem_ptr": "/a9d7569a" @@ -310,7 +310,7 @@ { - "model": "kepi.acobject", + "model": "bowler_pub.acobject", "pk": "/a9d75699", "fields": { "polymorphic_ctype": 45, @@ -319,7 +319,7 @@ } }, { - "model": "kepi.acitem", + "model": "bowler_pub.acitem", "pk": "/a9d75699", "fields": { "f_content": "This status is unlisted.", @@ -327,7 +327,7 @@ } }, { - "model": "kepi.acnote", + "model": "bowler_pub.acnote", "pk": "/a9d75699", "fields": { "acitem_ptr": "/a9d75699" diff --git a/chapeau/trilby_api/migrations/0001_initial.py b/chapeau/trilby_api/migrations/0001_initial.py index 4d799bc..88c9d8d 100644 --- a/chapeau/trilby_api/migrations/0001_initial.py +++ b/chapeau/trilby_api/migrations/0001_initial.py @@ -12,7 +12,7 @@ class Migration(migrations.Migration): initial = True dependencies = [ - ('kepi', '0001_initial'), + ('bowler_pub', '0001_initial'), ('auth', '0011_update_proxy_permissions'), ] @@ -31,7 +31,7 @@ class Migration(migrations.Migration): ('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')), ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')), ('email', models.EmailField(blank=True, max_length=254, unique=True, verbose_name='email address')), - ('actor', models.OneToOneField(null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='kepi.AcPerson')), + ('actor', models.OneToOneField(null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='bowler_pub.AcPerson')), ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')), ('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')), ], diff --git a/chapeau/trilby_api/migrations/0002_auto_20191009_1737.py b/chapeau/trilby_api/migrations/0002_auto_20191009_1737.py index 972269b..2dfb776 100644 --- a/chapeau/trilby_api/migrations/0002_auto_20191009_1737.py +++ b/chapeau/trilby_api/migrations/0002_auto_20191009_1737.py @@ -14,6 +14,6 @@ class Migration(migrations.Migration): migrations.AlterField( model_name='trilbyuser', name='actor', - field=models.OneToOneField(default=None, on_delete=django.db.models.deletion.CASCADE, to='kepi.AcPerson'), + field=models.OneToOneField(default=None, on_delete=django.db.models.deletion.CASCADE, to='bowler_pub.AcPerson'), ), ] diff --git a/chapeau/trilby_api/models.py b/chapeau/trilby_api/models.py index eae1fbb..764c09c 100644 --- a/chapeau/trilby_api/models.py +++ b/chapeau/trilby_api/models.py @@ -2,8 +2,8 @@ from django.db import models from django.db.models.signals import post_init from django.dispatch import receiver from django.contrib.auth.models import AbstractUser -from chapeau.kepi.models import AcPerson -from chapeau.kepi.create import create +from chapeau.bowler_pub.models import AcPerson +from chapeau.bowler_pub.create import create from django.conf import settings import chapeau.trilby_api.models diff --git a/chapeau/trilby_api/serializers.py b/chapeau/trilby_api/serializers.py index a42503d..a68ae4b 100644 --- a/chapeau/trilby_api/serializers.py +++ b/chapeau/trilby_api/serializers.py @@ -1,6 +1,6 @@ from rest_framework import serializers -from chapeau.kepi.models import AcItem, AcActor -from chapeau.kepi.create import create as kepi_create +from chapeau.bowler_pub.models import AcItem, AcActor +from chapeau.bowler_pub.create import create as bowler_pub_create from oauth2_provider.models import Application ######################################### @@ -135,7 +135,7 @@ class StatusSerializer(serializers.ModelSerializer): validated_data['posted_by'] = posted_by validated_data['type'] = 'Note' - result = kepi_create( + result = bowler_pub_create( value = validated_data, ) diff --git a/chapeau/trilby_api/tests/__init__.py b/chapeau/trilby_api/tests/__init__.py index 94d0bca..a4ccf4b 100644 --- a/chapeau/trilby_api/tests/__init__.py +++ b/chapeau/trilby_api/tests/__init__.py @@ -4,7 +4,7 @@ PUBLIC = "https://www.w3.org/ns/activitystreams#Public" def create_local_trilbyuser(name='jemima'): - from chapeau.kepi.tests import create_local_person + from chapeau.bowler_pub.tests import create_local_person from chapeau.trilby_api.models import TrilbyUser person = create_local_person(name=name) @@ -19,7 +19,7 @@ def create_local_trilbyuser(name='jemima'): def create_local_status(content, posted_by): - from chapeau.kepi.create import create + from chapeau.bowler_pub.create import create if isinstance(posted_by, TrilbyUser): posted_by = posted_by.actor diff --git a/chapeau/trilby_api/views.py b/chapeau/trilby_api/views.py index 36a6830..325634f 100644 --- a/chapeau/trilby_api/views.py +++ b/chapeau/trilby_api/views.py @@ -15,8 +15,8 @@ from rest_framework.permissions import IsAuthenticated from rest_framework.response import Response from rest_framework.renderers import JSONRenderer import logging -import chapeau.kepi.models as kepi_models -from chapeau.kepi.create import create as kepi_create +import chapeau.bowler_pub.models as bowler_pub_models +from chapeau.bowler_pub.create import create as bowler_pub_create import json import re @@ -116,7 +116,7 @@ class Statuses(generics.ListCreateAPIView, generics.DestroyAPIView, ): - queryset = kepi_models.AcCreate.objects.all() + queryset = bowler_pub_models.AcCreate.objects.all() serializer_class = StatusSerializer def get(self, request, *args, **kwargs): @@ -159,7 +159,7 @@ class Statuses(generics.ListCreateAPIView, content = 'You must supply a status or some media IDs', ) - create_activity = kepi_create(value={ + create_activity = bowler_pub_create(value={ 'type': 'Create', 'actor': request.user.actor.url, 'object': { @@ -195,7 +195,7 @@ class Statuses(generics.ListCreateAPIView, class StatusContext(generics.ListCreateAPIView): - queryset = kepi_models.AcCreate.objects.all() + queryset = bowler_pub_models.AcCreate.objects.all() def get(self, request, *args, **kwargs): @@ -243,7 +243,7 @@ class HomeTimeline(AbstractTimeline): result = [] - inbox = kepi_models.Collection.get( + inbox = bowler_pub_models.Collection.get( user = request.user.actor, collection = 'inbox').members @@ -263,11 +263,11 @@ class UserFeed(View): def get(self, request, username, *args, **kwargs): - user = get_object_or_404(kepi_models.AcActor, + user = get_object_or_404(bowler_pub_models.AcActor, id = '@'+username, ) - statuses = [x.member for x in kepi_models.Collection.get( + statuses = [x.member for x in bowler_pub_models.Collection.get( username+'/outbox', ).contents]