mirror of
https://github.com/m-labs/artiq.git
synced 2024-12-29 21:23:34 +08:00
merge artiq.coredevice.runtime into comm_kernel
This commit is contained in:
parent
2e4233274f
commit
64a0c4b29a
@ -5,6 +5,7 @@ import numpy
|
||||
import socket
|
||||
import re
|
||||
import linecache
|
||||
import os
|
||||
from enum import Enum
|
||||
from fractions import Fraction
|
||||
from collections import namedtuple
|
||||
@ -12,7 +13,6 @@ from collections import namedtuple
|
||||
from artiq.coredevice import exceptions
|
||||
from artiq.coredevice.comm import initialize_connection
|
||||
from artiq import __version__ as software_version
|
||||
from artiq.coredevice.runtime import source_loader
|
||||
from artiq import __artiq_dir__ as artiq_dir
|
||||
|
||||
|
||||
@ -175,6 +175,16 @@ class CommKernelDummy:
|
||||
pass
|
||||
|
||||
|
||||
class SourceLoader:
|
||||
def __init__(self, runtime_root):
|
||||
self.runtime_root = runtime_root
|
||||
|
||||
def get_source(self, filename):
|
||||
with open(os.path.join(self.runtime_root, filename)) as f:
|
||||
return f.read()
|
||||
|
||||
source_loader = SourceLoader(os.path.join(artiq_dir, "soc", "runtime"))
|
||||
|
||||
|
||||
class CoreException:
|
||||
"""Information about an exception raised or passed through the core device."""
|
||||
|
@ -1,14 +0,0 @@
|
||||
import os
|
||||
|
||||
from artiq import __artiq_dir__ as artiq_dir
|
||||
|
||||
|
||||
class SourceLoader:
|
||||
def __init__(self, runtime_root):
|
||||
self.runtime_root = runtime_root
|
||||
|
||||
def get_source(self, filename):
|
||||
with open(os.path.join(self.runtime_root, filename)) as f:
|
||||
return f.read()
|
||||
|
||||
source_loader = SourceLoader(os.path.join(artiq_dir, "soc", "runtime"))
|
Loading…
Reference in New Issue
Block a user