Allow simulator to be launched from arbitrary directory
Right now simulator.py expects messages_length.yaml to be in the current directory and as a result, it is impossible to launch simulator while you are at the repository root. The change makes simulator to search for the file in the same directory as simulator itself is in. Change-Id: Ic2ca21d87e2d888432dc6204c7b4b995a06aecbd
This commit is contained in:
parent
7f1aef5697
commit
09d5669565
@ -57,7 +57,8 @@ DISTRIBUTION_BUCKET_SIZE = 500
|
|||||||
|
|
||||||
def init_random_generator():
|
def init_random_generator():
|
||||||
data = []
|
data = []
|
||||||
with open('./messages_length.yaml') as m_file:
|
file_dir = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
with open(os.path.join(file_dir, 'messages_length.yaml')) as m_file:
|
||||||
content = yaml.safe_load(m_file)
|
content = yaml.safe_load(m_file)
|
||||||
data += [int(n) for n in content[
|
data += [int(n) for n in content[
|
||||||
'test_data']['string_lengths'].split(', ')]
|
'test_data']['string_lengths'].split(', ')]
|
||||||
|
Loading…
Reference in New Issue
Block a user