diff --git a/setup_main_tex_file.py b/setup_main_tex_file.py index cceb23a..f52cc2e 100755 --- a/setup_main_tex_file.py +++ b/setup_main_tex_file.py @@ -369,7 +369,8 @@ def main(): section_re = re.compile(r'\\section\{(?P.*?)\}') part_re = re.compile(r'\\part\{(?P.*?)}') subsection_re = re.compile(r'\\subsection\{(?P.*?)\}') - with open(args.master, 'r') as master_tex: + master_file = path.join('presentations', args.directory, 'diaporama.tex') + with open(master_file, 'r') as master_tex: master = master_tex.read() skbconfig = SKBCONFIG_RE.search(master) @@ -380,10 +381,10 @@ def main(): includes = SKBINPUT_RE.finditer(master) parts_list = [(part.start(), part_level, part.group('name')) for part in parts] sections_list = [(section.start(), section_level, section.group('name')) for section in sections] - includes_list = [element for skbinput in includes for element in outline_from_include(file_path_from_skbinput(skbinput, args.master, skbconfig), skbinput.start(), document_class)] + includes_list = [element for skbinput in includes for element in outline_from_include(file_path_from_skbinput(skbinput, master_file, skbconfig), skbinput.start(), document_class)] subsections_list = [(subsection.start(), subsection_level, subsection.group('name')) for subsection in subsections] structured_outline = structure_outline(filter_outlines(reorder_lists(parts_list, sections_list, includes_list, subsections_list))) - content_file = path.join(path.dirname(path.abspath(args.master)), 'programme', 'contenu.tex') + content_file = path.join(path.dirname(path.abspath(master_file)), 'programme', 'contenu.tex') with open(content_file, 'w') as content_fh: content_fh.write(structured_outline.render()) @@ -415,7 +416,7 @@ def main(): parser_update.add_argument('-m', '--master', help="Emplacement du fichier maître", required=True) parser_update.set_defaults(func=update) parser_outline = subparsers.add_parser('outline', help="Création du programme à partir du fichier maître") - parser_outline.add_argument('-m', '--master', help="Emplacement du fichier maître", required=True) + parser_outline.add_argument('-d', '--directory', help="Sous-répertoires contenant le diaporama", required=True) parser_outline.set_defaults(func=outline) args = parser.parse_args() args.func(args)