I am wanting you to create a python3 programm to take as input a Mojolicious Template file and output the same contents, but formatted in a way to make it structure easily understandable by a human. This involves identifying all html tags, mojolicious command and helper commands and also all perl constructs and indenting them in a such a way that subservient html and other statements are indented like an html prettifier, taking into account that the file may also include perl program statements which also should be properly formatted and indented to show the structure like perltidy. All "%" in the first non space character position in the line should be followed by a space unless followed by a specific mojolicious character such as "=". you can use any python3 libraries that you see fit. here is an example of a mojolicious template file which needs re-structuring: ``` % layout 'default', title => "Sme server 2 - yum_install"; % content_for 'module' => begin
%= dumper $c->current_route %= dumper $yum_datas
% }%=l 'yum_LABEL_AVAILABLE_GROUPS' % param 'SelectedGroups' => $c->get_names2('updates','group') unless param 'SelectedGroups'; %= select_field 'SelectedGroups' => $c->get_options2('available', 'group'), class => 'input', multiple => "1"
%}%=l 'yum_LABEL_AVAILABLE_PACKAGES' % param 'SelectedPackages' => $c->get_names2('updates','package') unless param 'SelectedPackages'; %= select_field 'SelectedPackages' => $c->get_options2('available', 'package'), class => 'input', multiple => "1"
%} %= hidden_field 'trt' => 'INST'%= dumper $c->current_route %= dumper $yum_datas
% }%=l 'yum_LABEL_AVAILABLE_GROUPS' % param 'SelectedGroups' => $c->get_names2('updates','group') unless param 'SelectedGroups'; %= select_field 'SelectedGroups' => $c->get_options2('available', 'group'), class => 'input', multiple => "1"
%}%=l 'yum_LABEL_AVAILABLE_PACKAGES' % param 'SelectedPackages' => $c->get_names2('updates','package') unless param 'SelectedPackages'; %= select_field 'SelectedPackages' => $c->get_options2('available', 'package'), class => 'input', multiple => "1"
%} %= hidden_field 'trt' => 'INST'
%=l 'DOMAIN_NAME', class => 'label'
% if ( $dom_datas->{trt} eq "ADD" ) {
% param 'Domain' => $dom_datas->{domain} unless param 'Domain';
%= text_field 'Domain', class => 'input'
% } else {
%= hidden_field 'Domain' => $dom_datas->{domain}
%= $dom_datas->{domain}, class => 'data'
% }
%=l 'DESCRIPTION_BRIEF', class => 'label'
% param 'Description' => $dom_datas->{description} unless param 'Description';
%= text_field 'Description', class => 'input'
%=l 'dom_CONTENT_FIELD_DESCRIPTION'
%= $c->l('dom_CONTENT', '');
% param 'Content' => $dom_datas->{content} unless param 'Content';
%= select_field 'Content', $c->content_options_list(), class => 'input'
%=l 'dom_DESC_NAMESERVERS'
%=l 'dom_LABEL_NAMESERVERS', class => 'label'
% param 'Nameservers' => $dom_datas->{nameservers} unless param 'Nameservers';
%= select_field 'Nameservers', $c->nameserver_options_list(), class => 'input'
%= submit_button "$btn", class => 'action'