Merge "Allow simulator to be launched from arbitrary directory"

This commit is contained in:
Jenkins 2016-04-07 16:20:06 +00:00 committed by Gerrit Code Review
commit 5e0e0e0901

View File

@ -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(', ')]