Files
dragonpilot/selfdrive/services.py

16 lines
412 B
Python
Raw Normal View History

2017-05-11 12:41:17 -07:00
import os
import yaml
class Service(object):
2019-06-28 21:11:30 +00:00
def __init__(self, port, should_log, frequency):
2017-05-11 12:41:17 -07:00
self.port = port
self.should_log = should_log
2019-06-28 21:11:30 +00:00
self.frequency = frequency
2017-05-11 12:41:17 -07:00
service_list_path = os.path.join(os.path.dirname(__file__), "service_list.yaml")
service_list = {}
with open(service_list_path, "r") as f:
2019-06-28 21:11:30 +00:00
for k, v in yaml.safe_load(f).items():
service_list[k] = Service(v[0], v[1], v[2])