Skip to content

Commit

Permalink
fixes lint
Browse files Browse the repository at this point in the history
  • Loading branch information
David Erb committed Feb 4, 2023
1 parent de4ebc4 commit 4a0fc68
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/dls_servbase_api/aiohttp_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

# Exceptions.
from dls_servbase_api.exceptions import (
ClientConnectorError as DlsBillyClientConnectorError,
ClientConnectorError as DlsServbaseClientConnectorError,
)

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -135,7 +135,7 @@ async def client_protocolj(self, request_object, cookies=None):

raise exception_class(exception_message)
except aiohttp.ClientConnectorError as exception:
raise DlsBillyClientConnectorError(
raise DlsServbaseClientConnectorError(
explain(exception, f"connecting to {callsign(self)}")
)

Expand Down
3 changes: 2 additions & 1 deletion src/dls_servbase_lib/base_aiohttp.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,9 +532,10 @@ async def release_cookies(self, opaque):
if self.__cookie_specification is None:
return

# logger.debug("[COOKOFF] releaseing cookies")
logger.info("[RELCOOK] releasing cookies")

for cookie in opaque.cookies.list():
logger.info("[RELCOOK] releasing cookie")
await cookie.release()

# ----------------------------------------------------------------------------------------
Expand Down
3 changes: 3 additions & 0 deletions src/dls_servbase_lib/cookies/dataface.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ async def release(self):
Release cookie and free its connections and other resources.
"""

logger.info(
f"[RELCOOK] releasing client to cookie dataface {str(self.__dataface)}"
)
if self.__dataface is not None:
await self.__dataface.close_client_session()
self.__dataface = None
8 changes: 4 additions & 4 deletions src/dls_servbase_lib/databases/aiosqlite.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import logging

# Base class for the aiosqlite database object.
from dls_normsql.aiosqlite import Aiosqlite as SqlinkyAiosqlite
from dls_normsql.aiosqlite import Aiosqlite as NormsqlAiosqlite

# Base class for our database definition.
from dls_servbase_lib.databases.database_definition import DatabaseDefinition
Expand All @@ -10,7 +10,7 @@


# ----------------------------------------------------------------------------------------
class Aiosqlite(DatabaseDefinition, SqlinkyAiosqlite):
class Aiosqlite(DatabaseDefinition, NormsqlAiosqlite):
"""
Class with coroutines for creating and querying a sqlite database.
We use dls-normsql to do the heavy lifting.
Expand All @@ -26,7 +26,7 @@ def __init__(self, specification):
DatabaseDefinition.__init__(self)

# Constructor for the database implementation.
SqlinkyAiosqlite.__init__(self, specification)
NormsqlAiosqlite.__init__(self, specification)

# ----------------------------------------------------------------------------------------
def reinstance(self):
Expand All @@ -44,7 +44,7 @@ async def add_table_definitions(self):
"""

# Add tables common in all implementations.
await SqlinkyAiosqlite.add_table_definitions(self)
await NormsqlAiosqlite.add_table_definitions(self)

# Add tables from our definition.
await DatabaseDefinition.add_table_definitions(self)
3 changes: 0 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ def logging_setup():
# Registering signal handler.
logging.getLogger("dls_utilpack.signal").setLevel("INFO")

# Set filter on the ispyb logger to ignore the annoying NOTICE.
logging.getLogger("ispyb").addFilter(_ispyb_logging_filter())

# Cover the version.
# logger.info("\n%s", (json.dumps(version_meta(), indent=4)))

Expand Down

0 comments on commit 4a0fc68

Please sign in to comment.