Skip to content

Commit

Permalink
Fixing imports (#93)
Browse files Browse the repository at this point in the history
Fixing imports
  • Loading branch information
mmolenda authored Jul 28, 2020
1 parent 3b01dda commit 415bed3
Show file tree
Hide file tree
Showing 21 changed files with 102 additions and 100 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Set PYTHONPATH
run: echo '::set-env name=PYTHONPATH::/home/runner/work/Missal1962/Missal1962/missal1962'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
14 changes: 7 additions & 7 deletions missal1962/apiv3.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@

from flask import jsonify, Blueprint

from missal1962 import __version__
from missal1962 import controller
from missal1962.constants import TRANSLATION
from missal1962.constants.common import LANGUAGES, LANGUAGE_ENGLISH
from missal1962.exceptions import InvalidInput, ProperNotFound, SupplementNotFound, SectionNotFound
from missal1962.kalendar.models import Day, Calendar
from missal1962.utils import format_day_propers, get_supplement, format_proper_sections, get_pregenerated_proper
import __version__
import controller
from constants import TRANSLATION
from constants.common import LANGUAGES, LANGUAGE_ENGLISH
from exceptions import InvalidInput, ProperNotFound, SupplementNotFound, SectionNotFound
from kalendar.models import Day, Calendar
from utils import format_day_propers, get_supplement, format_proper_sections, get_pregenerated_proper

logging.basicConfig(
stream=sys.stdout,
Expand Down
10 changes: 5 additions & 5 deletions missal1962/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
from flask_babel import Babel
from werkzeug.routing import BaseConverter, ValidationError

from missal1962.__version__ import __version__
from missal1962.apiv3 import api as apiv3
from missal1962.filters import slugify, asterisks2em, newline2br
from missal1962.constants.common import LANGUAGES
from missal1962.views import views
from __version__ import __version__
from apiv3 import api as apiv3
from filters import slugify, asterisks2em, newline2br
from constants.common import LANGUAGES
from views import views

logging.basicConfig(
stream=sys.stdout,
Expand Down
6 changes: 3 additions & 3 deletions missal1962/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

import click

from missal1962 import controller
from missal1962.kalendar.models import Calendar, Day
from missal1962.propers.models import Proper
import controller
from kalendar.models import Calendar, Day
from propers.models import Proper


logging.basicConfig(
Expand Down
4 changes: 2 additions & 2 deletions missal1962/constants/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
BLOCKS = {}

for lang in langs:
TRANSLATION[lang] = importlib.import_module(f'missal1962.constants.{lang}.translation')
BLOCKS[lang] = importlib.import_module(f'missal1962.constants.{lang}.blocks')
TRANSLATION[lang] = importlib.import_module(f'constants.{lang}.translation')
BLOCKS[lang] = importlib.import_module(f'constants.{lang}.blocks')
2 changes: 1 addition & 1 deletion missal1962/constants/la/blocks.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import itertools

from missal1962.constants import common as constants
from constants import common as constants

POST_EPIPHANY = (
(constants.TEMPORA_EPI1_0,),
Expand Down
2 changes: 1 addition & 1 deletion missal1962/constants/la/translation.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import re

from missal1962.constants import common as constants
from constants import common as constants

TITLES = {
constants.TEMPORA_EPI1_0: 'Sanctæ Familiæ Jesu Mariæ Joseph',
Expand Down
2 changes: 1 addition & 1 deletion missal1962/constants/pl/translation.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import re

from missal1962.constants import common as constants
from constants import common as constants

TITLES = {
constants.TEMPORA_EPI1_0: 'Uroczystość Świętej Rodziny Jezusa, Maryi i Józefa',
Expand Down
12 changes: 6 additions & 6 deletions missal1962/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
from functools import lru_cache
from typing import List, Tuple

from missal1962 import ical
from missal1962.kalendar.factory import MissalFactory
from missal1962.kalendar.models import Calendar, Day
from missal1962.propers.models import Proper, ProperConfig
from missal1962.propers.parser import ProperParser
from missal1962.utils import get_custom_preface
import ical
from kalendar.factory import MissalFactory
from kalendar.models import Calendar, Day
from propers.models import Proper, ProperConfig
from propers.parser import ProperParser
from utils import get_custom_preface

no_cache = bool(os.environ.get('MISSAL_NO_CACHE'))

Expand Down
2 changes: 1 addition & 1 deletion missal1962/ical.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from icalendar import Calendar, Event
from typing import Dict

from missal1962.kalendar.models import Day
from kalendar.models import Day


class IcalBuilder:
Expand Down
8 changes: 4 additions & 4 deletions missal1962/kalendar/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

from dateutil.easter import easter

from missal1962.constants import BLOCKS
from missal1962.constants.common import TEMPORA_NAT2_0, SANCTI_10_DUr, LANGUAGE_ENGLISH
from missal1962.kalendar.models import Calendar, Observance
from missal1962.kalendar.rules import rules
from constants import BLOCKS
from constants.common import TEMPORA_NAT2_0, SANCTI_10_DUr, LANGUAGE_ENGLISH
from kalendar.models import Calendar, Observance
from kalendar.rules import rules


class MissalFactory:
Expand Down
32 changes: 16 additions & 16 deletions missal1962/kalendar/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@
from datetime import date, timedelta
from typing import ItemsView, List, Tuple, Union

from missal1962.constants.common import (TEMPORA_C_10A, TEMPORA_C_10B, TEMPORA_C_10C, TEMPORA_C_10PASC, TEMPORA_C_10T,
TABLE_OF_PRECEDENCE, TEMPORA_EPI1_0,
TEMPORA_EPI1_0A, TEMPORA_PENT01_0,
TEMPORA_RANK_MAP, TYPE_TEMPORA, WEEKDAY_MAPPING, PATTERN_EASTER,
PATTERN_PRE_LENTEN,
PATTERN_LENT, GRADUALE_PASCHAL, TRACTUS, GRADUALE,
CUSTOM_INTER_READING_SECTIONS,
SUNDAY, PATTERN_POST_EPIPHANY_SUNDAY, TEMPORA_PENT23_0, INTROIT, OFFERTORIUM,
COMMUNIO,
TEMPORA_NAT2_0, SANCTI_01_01, PREFATIO_COMMUNIS, TEMPORA_PASC5_0,
TEMPORA_PASC5_4,
TEMPORA_PENT01_0A)
from missal1962.propers.models import Proper, ProperConfig
from missal1962.propers.parser import ProperParser
from missal1962.utils import get_custom_preface, match
from constants.common import (TEMPORA_C_10A, TEMPORA_C_10B, TEMPORA_C_10C, TEMPORA_C_10PASC, TEMPORA_C_10T,
TABLE_OF_PRECEDENCE, TEMPORA_EPI1_0,
TEMPORA_EPI1_0A, TEMPORA_PENT01_0,
TEMPORA_RANK_MAP, TYPE_TEMPORA, WEEKDAY_MAPPING, PATTERN_EASTER,
PATTERN_PRE_LENTEN,
PATTERN_LENT, GRADUALE_PASCHAL, TRACTUS, GRADUALE,
CUSTOM_INTER_READING_SECTIONS,
SUNDAY, PATTERN_POST_EPIPHANY_SUNDAY, TEMPORA_PENT23_0, INTROIT, OFFERTORIUM,
COMMUNIO,
TEMPORA_NAT2_0, SANCTI_01_01, PREFATIO_COMMUNIS, TEMPORA_PASC5_0,
TEMPORA_PASC5_4,
TEMPORA_PENT01_0A)
from propers.models import Proper, ProperConfig
from propers.parser import ProperParser
from utils import get_custom_preface, match

log = logging.getLogger(__name__)

Expand Down Expand Up @@ -67,7 +67,7 @@ def __init__(self, observance_id: str, date_: date, lang: str):
"""
self.date = date_
self.lang = lang
translation = importlib.import_module(f'missal1962.constants.{lang}.translation')
translation = importlib.import_module(f'constants.{lang}.translation')
flexibility, name, rank, color = observance_id.split(':')
self.flexibility: str = flexibility
self.name: str = name
Expand Down
36 changes: 18 additions & 18 deletions missal1962/kalendar/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,24 @@
from datetime import date, timedelta
from typing import List

from missal1962.constants.common import (TEMPORA_C_10A, TEMPORA_C_10B, TEMPORA_C_10C, TEMPORA_C_10PASC, TEMPORA_C_10T,
EMBER_DAYS,
FEASTS_OF_JESUS_CLASS_1_AND_2, PATTERN_ADVENT,
PATTERN_CLASS_1, PATTERN_EASTER,
PATTERN_SANCTI_CLASS_1_OR_2,
PATTERN_SANCTI_CLASS_2, PATTERN_TEMPORA,
PATTERN_TEMPORA_SUNDAY,
PATTERN_TEMPORA_SUNDAY_CLASS_2, SANCTI_01_13,
SANCTI_02_24, SANCTI_02_27, SANCTI_11_02_1,
SANCTI_12_24, SANCTI_12_25_1,
TEMPORA_EPI1_0, TEMPORA_PASC0_0, TEMPORA_QUAD6_1,
TEMPORA_QUAD6_2, TEMPORA_QUAD6_3,
TEMPORA_QUAD6_4, TEMPORA_QUAD6_5,
TEMPORA_QUAD6_6, TEMPORA_QUADP3_3,
SANCTI_09_29, PATTERN_SANCTI_CLASS_4, PATTERN_LENT, PATTERN_SANCTI, SUNDAY,
PATTERN_TEMPORA_CLASS_4)
from missal1962.kalendar.models import Calendar, Observance
from missal1962.utils import match
from constants.common import (TEMPORA_C_10A, TEMPORA_C_10B, TEMPORA_C_10C, TEMPORA_C_10PASC, TEMPORA_C_10T,
EMBER_DAYS,
FEASTS_OF_JESUS_CLASS_1_AND_2, PATTERN_ADVENT,
PATTERN_CLASS_1, PATTERN_EASTER,
PATTERN_SANCTI_CLASS_1_OR_2,
PATTERN_SANCTI_CLASS_2, PATTERN_TEMPORA,
PATTERN_TEMPORA_SUNDAY,
PATTERN_TEMPORA_SUNDAY_CLASS_2, SANCTI_01_13,
SANCTI_02_24, SANCTI_02_27, SANCTI_11_02_1,
SANCTI_12_24, SANCTI_12_25_1,
TEMPORA_EPI1_0, TEMPORA_PASC0_0, TEMPORA_QUAD6_1,
TEMPORA_QUAD6_2, TEMPORA_QUAD6_3,
TEMPORA_QUAD6_4, TEMPORA_QUAD6_5,
TEMPORA_QUAD6_6, TEMPORA_QUADP3_3,
SANCTI_09_29, PATTERN_SANCTI_CLASS_4, PATTERN_LENT, PATTERN_SANCTI, SUNDAY,
PATTERN_TEMPORA_CLASS_4)
from kalendar.models import Calendar, Observance
from utils import match


def rule_nativity_has_multiple_masses(
Expand Down
4 changes: 2 additions & 2 deletions missal1962/propers/models.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from copy import copy
from typing import ItemsView, KeysView, List, Union, ValuesView

from missal1962.constants.common import VISIBLE_SECTIONS, GRADUALE, TRACTUS, GRADUALE_PASCHAL, COMMEMORATED_ORATIO, \
from constants.common import VISIBLE_SECTIONS, GRADUALE, TRACTUS, GRADUALE_PASCHAL, COMMEMORATED_ORATIO, \
COMMEMORATED_SECRETA, COMMEMORATED_POSTCOMMUNIO, POSTCOMMUNIO, SECRETA, ORATIO, COMMEMORATION
from missal1962.exceptions import ProperNotFound
from exceptions import ProperNotFound


class ParsedSource:
Expand Down
24 changes: 12 additions & 12 deletions missal1962/propers/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
import re
from typing import Tuple, Union

import missal1962.utils as utils
from missal1962.exceptions import InvalidInput, ProperNotFound

from missal1962.constants import TRANSLATION
from missal1962.constants.common import (CUSTOM_DIVOFF_DIR, DIVOFF_DIR, LANGUAGE_LATIN, DIVOFF_LANG_MAP,
REFERENCE_REGEX,
SECTION_REGEX, EXCLUDE_SECTIONS_IDX, ASTERISK, PATTERN_COMMEMORATION,
PREFATIO_COMMUNIS,
VISIBLE_SECTIONS, TRACTUS, GRADUALE, GRADUALE_PASCHAL, PATTERN_ALLELUIA,
PREFATIO_OMIT,
OBSERVANCES_WITHOUT_OWN_PROPER, PATTERN_TRACT)
from missal1962.propers.models import Proper, Section, ProperConfig, ParsedSource
import utils as utils
from exceptions import InvalidInput, ProperNotFound

from constants import TRANSLATION
from constants.common import (CUSTOM_DIVOFF_DIR, DIVOFF_DIR, LANGUAGE_LATIN, DIVOFF_LANG_MAP,
REFERENCE_REGEX,
SECTION_REGEX, EXCLUDE_SECTIONS_IDX, ASTERISK, PATTERN_COMMEMORATION,
PREFATIO_COMMUNIS,
VISIBLE_SECTIONS, TRACTUS, GRADUALE, GRADUALE_PASCHAL, PATTERN_ALLELUIA,
PREFATIO_OMIT,
OBSERVANCES_WITHOUT_OWN_PROPER, PATTERN_TRACT)
from propers.models import Proper, Section, ProperConfig, ParsedSource

log = logging.getLogger(__name__)

Expand Down
4 changes: 2 additions & 2 deletions missal1962/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import mistune
import yaml

from missal1962.constants.common import CUSTOM_PREFACES, PROPERS_DIR, SUPPLEMENT_DIR
from missal1962.exceptions import SupplementNotFound, SectionNotFound
from constants.common import CUSTOM_PREFACES, PROPERS_DIR, SUPPLEMENT_DIR
from exceptions import SupplementNotFound, SectionNotFound


def match(observances: Union[str, 'Observance', List[Union[str, 'Observance']]], # noqa: F821
Expand Down
12 changes: 6 additions & 6 deletions missal1962/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
from flask_babel import _
from jinja2 import TemplateNotFound

from missal1962 import controller
from missal1962.constants import TRANSLATION, BLOCKS
from missal1962.constants.common import LANGUAGES, LANGUAGE_ENGLISH, SUPPLEMENT_DIR
from missal1962.exceptions import SupplementNotFound
from missal1962.kalendar.models import Day
from missal1962.utils import format_day_propers, get_supplement, format_propers
import controller
from constants import TRANSLATION, BLOCKS
from constants.common import LANGUAGES, LANGUAGE_ENGLISH, SUPPLEMENT_DIR
from exceptions import SupplementNotFound
from kalendar.models import Day
from utils import format_day_propers, get_supplement, format_propers

logging.basicConfig(
stream=sys.stdout,
Expand Down
6 changes: 3 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import pytest

from missal1962 import app
from missal1962.constants.common import LANGUAGE_LATIN
from missal1962.kalendar.factory import MissalFactory
import app
from constants.common import LANGUAGE_LATIN
from kalendar.factory import MissalFactory

HERE = os.path.abspath(os.path.dirname(__file__))

Expand Down
2 changes: 1 addition & 1 deletion tests/test_apiv3.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import pytest

from .conftest import HERE
from missal1962.constants.common import LANGUAGES
from constants.common import LANGUAGES


def test_api_calendar(client):
Expand Down
6 changes: 3 additions & 3 deletions tests/test_calendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

import pytest

from missal1962.constants import common as c
from missal1962.kalendar.models import Observance
from missal1962.utils import match
from constants import common as c
from kalendar.models import Observance
from utils import match
from tests.conftest import get_missal, HERE

language = 'pl'
Expand Down
12 changes: 6 additions & 6 deletions tests/test_propers.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import json
from datetime import date

from missal1962.constants.common import *
from missal1962.exceptions import InvalidInput, ProperNotFound
from constants.common import *
from exceptions import InvalidInput, ProperNotFound

import pytest
import re

from missal1962.constants import common as c
from missal1962.kalendar.models import Observance
from missal1962.propers.models import ProperConfig
from missal1962.propers.parser import ProperParser
from constants import common as c
from kalendar.models import Observance
from propers.models import ProperConfig
from propers.parser import ProperParser
from tests.conftest import get_missal, HERE

language = 'pl'
Expand Down

0 comments on commit 415bed3

Please sign in to comment.