Skip to content

Commit

Permalink
Orthography refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
fbanados committed Oct 21, 2024
1 parent b2c60a2 commit 725ab73
Show file tree
Hide file tree
Showing 20 changed files with 20 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
)
from morphodict.relabelling import read_labels
from morphodict.utils import url_for_query
from CreeDictionary.morphodict.templatetags.morphodict_orth import orth_tag
from morphodict.orthography.templatetags.morphodict_orth import orth_tag
from morphodict.lexicon.models import Wordform

register = template.Library()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from django.template import Context

from morphodict.relabelling import read_labels
from CreeDictionary.morphodict.templatetags.morphodict_orth import orth_tag
from morphodict.orthography.templatetags.morphodict_orth import orth_tag
from morphodict.utils.types import FSTTag
from crkeng.app.preferences import DisplayMode

Expand Down
17 changes: 0 additions & 17 deletions src/CreeDictionary/morphodict/README.md

This file was deleted.

5 changes: 0 additions & 5 deletions src/CreeDictionary/morphodict/apps.py

This file was deleted.

2 changes: 0 additions & 2 deletions src/CreeDictionary/morphodict/paradigms.py

This file was deleted.

Empty file.
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from CreeDictionary.CreeDictionary.orthography import to_macrons, to_syllabics
from morphodict.paradigm.panes import RowLabel
from CreeDictionary.morphodict.orthography import ORTHOGRAPHY
from morphodict.orthography import ORTHOGRAPHY
from pytest_django.asserts import assertInHTML
from crkeng.app.preferences import DisplayMode

Expand Down
File renamed without changes.
5 changes: 5 additions & 0 deletions src/morphodict/orthography/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from django.apps import AppConfig


class OrthographyConfig(AppConfig):
name = "morphodict.orthography"
File renamed without changes.
2 changes: 1 addition & 1 deletion src/morphodict/orthography/templatetags/morphodict_orth.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from django.conf import settings
from django.utils.html import format_html

from ..orthography import ORTHOGRAPHY
from morphodict.orthography import ORTHOGRAPHY

register = template.Library()

Expand Down
2 changes: 1 addition & 1 deletion src/morphodict/orthography/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from . import views

app_name = "morphodict"
app_name = "morphodict.orthography"
urlpatterns = [
path(
"change-orthography",
Expand Down
2 changes: 1 addition & 1 deletion src/morphodict/orthography/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from django.http import HttpResponse
from django.views import View

from .orthography import ORTHOGRAPHY
from morphodict.orthography import ORTHOGRAPHY


class ChangeOrthography(View):
Expand Down
4 changes: 2 additions & 2 deletions src/morphodict/site/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"morphodict.cvd",
"morphodict.search_quality",
"morphodict.phrase_translate",
"CreeDictionary.morphodict.apps.MorphodictConfig",
"morphodict.orthography",
# This comes last so that other apps can override templates
"django.contrib.admin",
]
Expand All @@ -98,7 +98,7 @@
"morphodict.site.securemiddleware.set_secure_headers",
]

ROOT_URLCONF = "CreeDictionary.CreeDictionary.urls"
ROOT_URLCONF = "morphodict.urls"

TEMPLATES = [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ def test_default_config_exists():
"""
A really trivial "test case": just checking that the app can be instantiated.
"""
app = AppConfig.create("CreeDictionary.morphodict.apps.MorphodictConfig")
assert "morphodict" in app.name
app = AppConfig.create("morphodict.orthography.apps.OrthographyConfig")
assert "orthography" in app.name
4 changes: 2 additions & 2 deletions src/morphodict/tests/test_orth_cookie.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import pytest
from django.urls import reverse

from CreeDictionary.morphodict.orthography import ORTHOGRAPHY
from morphodict.orthography import ORTHOGRAPHY


@pytest.mark.parametrize(
Expand Down Expand Up @@ -62,4 +62,4 @@ def test_no_orthography(client, change_orth_url):

@pytest.fixture
def change_orth_url():
return reverse("morphodict:change-orthography")
return reverse("morphodict.orthography:change-orthography")
2 changes: 1 addition & 1 deletion src/morphodict/tests/test_orth_templatetags.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- coding: UTF-8 -*-

import pytest
from CreeDictionary.morphodict.templatetags.morphodict_orth import orth
from morphodict.orthography.templatetags.morphodict_orth import orth


def test_orth_requires_two_arguments():
Expand Down
2 changes: 1 addition & 1 deletion src/morphodict/tests/test_usage_of_morphodict.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""

import pytest
from CreeDictionary.morphodict.orthography import ORTHOGRAPHY
from morphodict.orthography import ORTHOGRAPHY


def test_morphodict_orthography():
Expand Down
2 changes: 1 addition & 1 deletion src/morphodict/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
############################## Other applications ##############################
path("admin/", admin.site.urls),
path("search-quality/", include("morphodict.search_quality.urls")),
path("", include("CreeDictionary.morphodict.urls")),
path("", include("morphodict.orthography.urls")),
path("", include("morphodict.api.urls")),
path(
"sitemap.xml",
Expand Down

0 comments on commit 725ab73

Please sign in to comment.