# Generate skills sections and others from a file, on the long run, it should be able to generate the whole sheet import argparse, sys, os # # # def printable(name): return name.replace(" ","").lower() def checked(b): if b==1: return 'checked="checked"' return "" def gen_tab(name,tab_nb): return ''.format(name=name,nb=tab_nb,checked=checked(tab_nb)) #
#
# # # def gen_subtab(name,secname,tab_nb,subtab_nb): if subtab_nb==1: intro="""
""".format(tab_nb) else: intro="" line="""""".format(name=name,nb=subtab_nb,check=checked(subtab_nb)) return intro+line # #

Compétences Intellectuelles

#
# # # # # #
#
def gen_repeating(name): pass # # # # # # # # #
#
def gen_technique(name,tab_name,tab_nb,first_technique): if first_technique: intro="""
""".format(name) else: intro="" pass if __name__ == '__main__': # filen=sys.argv[1] filen="cyberpnk.txt" def parse(filen): tab,subtab="","" tab_nb,subtab_nb=0,0 first_technique=True try: with open(filen) as f: for line in f.readlines(): if line[0]=="#": # section first_technique=True subtab_content=gen_tab(line[1:],tab_nb) tab=printable(line[1:]) print(tab,subtab_content) tab_nb+=1 elif line[0]=="@": # first_technique=True subtab_content=gen_subtab(line[1:],tab,tab_nb,subtab_nb) subtab=printable(line[1:]) print(subtab,subtab_content) elif line[0]==":": tech_content=gen_technique(line[1:],tab,tab_nb,first_technique) # tech=printable() except FileNotFoundError: print(filen,"was not found") parse(filen)