Skip to content

Commit 1ffb365

Browse files
committed
Transport type should be 'PikaTransport', not 'pika'; added type hints to indicate this
1 parent 1565e5b commit 1ffb365

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/murfey/server/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from importlib.resources import files
1212
from pathlib import Path
1313
from threading import Thread
14-
from typing import Any, Dict, List, NamedTuple, Tuple
14+
from typing import Any, Dict, List, Literal, NamedTuple, Tuple
1515

1616
import graypy
1717
import mrcfile
@@ -296,7 +296,7 @@ def run():
296296
else:
297297
# Load RabbitMQ configuration and set up the connection
298298
PikaTransport().load_configuration_file(security_config.rabbitmq_credentials)
299-
_set_up_transport("pika")
299+
_set_up_transport("PikaTransport")
300300

301301
# Set up logging now that the desired verbosity is known
302302
_set_up_logging(quiet=args.quiet, verbosity=args.verbose)
@@ -395,7 +395,7 @@ def _set_up_logging(quiet: bool, verbosity: int):
395395
logging.getLogger(logger_name).setLevel(log_level)
396396

397397

398-
def _set_up_transport(transport_type):
398+
def _set_up_transport(transport_type: Literal["PikaTransport"]):
399399
global _transport_object
400400
_transport_object = TransportManager(transport_type)
401401

src/murfey/server/ispyb.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import datetime
44
import logging
55
import os
6-
from typing import Callable, List, Optional
6+
from typing import Callable, List, Literal, Optional
77

88
import ispyb
99

@@ -55,7 +55,7 @@ def _send_using_new_connection(transport_type: str, queue: str, message: dict) -
5555

5656

5757
class TransportManager:
58-
def __init__(self, transport_type):
58+
def __init__(self, transport_type: Literal["PikaTransport"]):
5959
self._transport_type = transport_type
6060
self.transport = workflows.transport.lookup(transport_type)()
6161
self.transport.connect()

0 commit comments

Comments
 (0)