Hi,
while following the tutorial [1], I made a typo trying loading a
configuration-file in the tasks ruby-script:
{{{
message_producer.apply_conf_file("unintnetional_typo.yml")
}}}
After following the code, it looks like the "load_file" function in
"tools/orocos.rb/lib/orocos/configuration.rb" silently returns on
non-existent filenames, instead if issuing a warning.
Wouldn't be a message nice? See attached patch.
Greetings
Martin
[1]
http://rock-robotics.org/stable/documentation/tutorials/120_basics_configure_component.html
--
M.Sc. Martin Zenzes
Space Robotics
Hauptgeschäftsstelle Standort Bremen:
DFKI GmbH
Robotics Innovation Center
Robert-Hooke-Straße 5
28359 Bremen, Germany
Phone: +49 (0) 421 178 45 - 6658
Fax: +49 (0) 421 178 45 - 4150
E-Mail: [email protected]
Weitere Informationen: http://www.dfki.de/robotik
-----------------------------------------------------------------------
Deutsches Forschungszentrum fuer Kuenstliche Intelligenz GmbH
Firmensitz: Trippstadter Straße 122, D-67663 Kaiserslautern
Geschaeftsfuehrung: Prof. Dr. Dr. h.c. mult. Wolfgang Wahlster
(Vorsitzender) Dr. Walter Olthoff
Vorsitzender des Aufsichtsrats: Prof. Dr. h.c. Hans A. Aukes
Amtsgericht Kaiserslautern, HRB 2313
Sitz der Gesellschaft: Kaiserslautern (HRB 2313)
USt-Id.Nr.: DE 148646973
Steuernummer: 19/673/0060/3
-----------------------------------------------------------------------
>From 208945b698510dc324dfd8543fc9185eae46895d Mon Sep 17 00:00:00 2001
From: Martin Zenzes <[email protected]>
Date: Fri, 22 Nov 2013 15:59:18 +0100
Subject: [PATCH 1/1] configuration: warning on trying to load non-existant
filename
Signed-off-by: Martin Zenzes <[email protected]>
---
lib/orocos/configurations.rb | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/lib/orocos/configurations.rb b/lib/orocos/configurations.rb
index dbc8c58..3af2e11 100644
--- a/lib/orocos/configurations.rb
+++ b/lib/orocos/configurations.rb
@@ -635,7 +635,11 @@ def load_dir(dir)
# Otherwise, it returns a mapping from task model names to the list of
# configuration sections that have changed for this particular model
def load_file(file,model_name = nil)
- return if !File.file?(file)
+ if !File.file?(file)
+ ConfigurationManager.warn "ignoring configuration file #{file}, not existent"
+ return
+ end
+
model_name ||= File.basename(file, '.yml')
begin
--
1.7.9.5
_______________________________________________
Rock-dev mailing list
[email protected]
http://www.dfki.de/mailman/cgi-bin/listinfo/rock-dev