Skip to content

Commit

Permalink
pyupgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
jensens committed Nov 10, 2023
1 parent 4ca98c2 commit bc97d63
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
1 change: 0 additions & 1 deletion src/collective/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
__import__("pkg_resources").declare_namespace(__name__)
9 changes: 4 additions & 5 deletions src/collective/elastic/ingest/analysis/analysis.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
from ..elastic import get_ingest_client
from ..logging import logger
from collective.elastic.ingest import ELASTICSEARCH_7
Expand All @@ -9,20 +8,20 @@
import os


_analysis_file = os.environ.get(
"ANALYSIS_FILE", None)
)
_analysis_file = os.environ.get("ANALYSIS_FILE", None)


ANALYSISMAP = None
if _analysis_file:
try:
with open(_analysis_file, mode="r") as fp:
with open(_analysis_file) as fp:
ANALYSISMAP = json.load(fp)
except FileNotFoundError:
logger.warning(f"Analysis file '{_analysis_file}' not found.")
else:
logger.info("No analysis file configured.")


def update_analysis(index_name):
"""Provide elasticsearch with analyzers to be used in mapping.
Expand Down
4 changes: 0 additions & 4 deletions src/collective/elastic/ingest/logging.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import


try:
import collective.elastic.plone # noqa: W291
import logging
Expand Down

0 comments on commit bc97d63

Please sign in to comment.