Browse Source

px_generate_uorb_topic_files.py: add multitopics to generate_topics_list_file_from_files method

sbg
Beat Küng 9 years ago
parent
commit
79f2cd79d9
  1. 7
      Tools/px_generate_uorb_topic_files.py

7
Tools/px_generate_uorb_topic_files.py

@ -264,7 +264,7 @@ def generate_topics_list_file(msgdir, outputdir, templatedir): @@ -264,7 +264,7 @@ def generate_topics_list_file(msgdir, outputdir, templatedir):
for msg in msgs:
msg_filename = os.path.join(msgdir, msg)
multi_topics.extend(get_multi_topics(msg_filename))
tl_globals = {"msgs" : msgs, "multi_topics": multi_topics}
tl_globals = {"msgs" : msgs, "multi_topics" : multi_topics}
tl_template_file = os.path.join(templatedir, TOPICS_LIST_TEMPLATE_FILE)
tl_out_file = os.path.join(outputdir, TOPICS_LIST_TEMPLATE_FILE.replace(".template", ""))
generate_by_template(tl_out_file, tl_template_file, tl_globals)
@ -272,7 +272,10 @@ def generate_topics_list_file(msgdir, outputdir, templatedir): @@ -272,7 +272,10 @@ def generate_topics_list_file(msgdir, outputdir, templatedir):
def generate_topics_list_file_from_files(files, outputdir, templatedir):
# generate cpp file with topics list
filenames = [os.path.basename(p) for p in files if os.path.basename(p).endswith(".msg")]
tl_globals = {"msgs" : filenames}
multi_topics = []
for msg_filename in files:
multi_topics.extend(get_multi_topics(msg_filename))
tl_globals = {"msgs" : filenames, "multi_topics" : multi_topics}
tl_template_file = os.path.join(templatedir, TOPICS_LIST_TEMPLATE_FILE)
tl_out_file = os.path.join(outputdir, TOPICS_LIST_TEMPLATE_FILE.replace(".template", ""))
generate_by_template(tl_out_file, tl_template_file, tl_globals)

Loading…
Cancel
Save