simpler function
@@ -13,6 +13,7 @@ import time
import math
import threading
+from moler.io.raw.memory import ThreadedFifoBuffer
from moler.device import DeviceFactory
from moler.device.textualdevice import TextualDevice
from moler.exceptions import MolerException
@@ -149,11 +150,6 @@ def get_cloned_device(src_device, new_name, new_connection):
return device
-def get_memory_device_connection():
- from moler.io.raw.memory import ThreadedFifoBuffer
- from moler.threaded_moler_connection import ThreadedMolerConnection
- from moler.config.loggers import configure_device_logger
-
class RemoteConnection(ThreadedFifoBuffer):
def __init__(self, moler_connection, echo=True, name=None, logger_name=""):
@@ -213,6 +209,11 @@ def get_memory_device_connection():
send = write # just alias to make base class happy :-)
+
+def get_memory_device_connection():
+ from moler.threaded_moler_connection import ThreadedMolerConnection
+ from moler.config.loggers import configure_device_logger
+
moler_conn = ThreadedMolerConnection(encoder=lambda data: data.encode("utf-8"),
decoder=lambda data: data.decode("utf-8"),
name="buffer")
