Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahelsamahy committed Oct 21, 2024
1 parent a6ad1ed commit 44b40d0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
9 changes: 4 additions & 5 deletions jetson_runtime/teleop/teleop/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def __init__(self, tel_chatter, throttle_controller, fol_comm_socket, event, hz,

def __check_configuration_files(self):
_candidates = glob.glob(os.path.join(self._config_dir, "*.ini"))

# print(_candidates) #FOR DEBUGGING
for file_path in _candidates:
# Extract the filename from the path
file_name = os.path.basename(file_path)
Expand All @@ -85,9 +85,9 @@ def __check_configuration_files(self):
elif file_name == "config.ini":
self._user_config_file = file_path

# Optional: Check if both files were found
# Check if both files were found
if self._robot_config_file is None or self._user_config_file is None:
logger.info("Warning: Not all config files were found")
logger.error("Warning: Not all config files were found")

def _config(self):
parser = SafeConfigParser()
Expand All @@ -103,8 +103,7 @@ def get_robot_config_file(self):

def read_user_config(self):
"""
Reads the configuration file, flattens the configuration sections and keys,
and initializes components with specific configuration values.
Reads the configuration file, flattens the configuration sections and keys,and initializes components with specific configuration values.
"""
config = configparser.ConfigParser()
config.read(self.get_user_config_file())
Expand Down
2 changes: 2 additions & 0 deletions jetson_runtime/teleop/teleop/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,8 @@ def set_option(self, section, name, value):
def reload(self):
if os.path.exists(self._fname):
self._parser.read(self._fname)
else:
logger.error("path doesn't exist:", self._fname)

def save(self):
# The options could have been updated on disk.
Expand Down
2 changes: 0 additions & 2 deletions jetson_runtime/vehicles/rover/pytest.ini

This file was deleted.

0 comments on commit 44b40d0

Please sign in to comment.