def choose_schema(self, out_file):
path = os.path.dirname(lazyconf.__file__) + '<STR_LIT>'<EOL>self.prompt.header('<STR_LIT>')<EOL>i = <NUM_LIT:0><EOL>choices = []<EOL>for filename in os.listdir(path):<EOL><INDENT>if filename.endswith('<STR_LIT>'):<EOL><INDENT>try:<EOL><INDENT>template = self._load(path + filename)<EOL>description = template.get('<STR_LIT>')<EOL>prompt_string = str(i + <NUM_LIT:1>) + '<STR_LIT>' + filename<EOL>i += <NUM_LIT:1><EOL>if description:<EOL><INDENT>self.prompt.notice(prompt_string + '<STR_LIT>' + description)<EOL><DEDENT>else:<EOL><INDENT>self.prompt.notice(prompt_string)<EOL><DEDENT>choices.append(template)<EOL><DEDENT>except IOError as e:<EOL><INDENT>print(self.prompt.error(str(e)))<EOL><DEDENT><DEDENT><DEDENT>val = <NUM_LIT:0><EOL>while val is <NUM_LIT:0> or val > i:<EOL><INDENT>val = self.prompt.int('<STR_LIT>', default = <NUM_LIT:1>)<EOL>if val is <NUM_LIT:0> or val > i:<EOL><INDENT>self.prompt.error('<STR_LIT>' + str(i) + '<STR_LIT:.>')<EOL><DEDENT><DEDENT>schema = choices[val-<NUM_LIT:1>]<EOL>if '<STR_LIT>' in list(schema.data.keys()):<EOL><INDENT>del(schema.data['<STR_LIT>'])<EOL><DEDENT>schema.save(out_file, as_schema=True)<EOL>sp, sf = os.path.split(out_file)<EOL>self.prompt.success('<STR_LIT>' + self.lazy_folder + sf + '<STR_LIT:.>')<EOL>return schema<EOL>
Finds all schema templates and prompts to choose one. Copies the file to self.lazy_folder.