def _get_app_template(self, app, top_win):
    'build template string for application'
    if (not self.app_name):
        return None
    klass = app.klass
    if self._use_gettext:
        gettext1 = ['%(tab)smy $local = Wx::Locale->new("English", "en", "en"); # replace with ??', '%(tab)s$local->AddCatalog("%(textdomain)s"); # replace with the appropriate catalog name\n']
    else:
        gettext1 = []
    if klass:
        ret = ['package %(klass)s;', '', 'use base qw(Wx::App);', 'use strict;', '%(pl_import)s', 'sub OnInit {', '%(tab)smy( $self ) = shift;', '', '%(tab)sWx::InitAllImageHandlers();', '', '%(tab)smy $%(top_win)s = %(top_win_class)s->new();', '', '%(tab)s$self->SetTopWindow($%(top_win)s);', '%(tab)s$%(top_win)s->Show(1);', '', '%(tab)sreturn 1;', '}']
        if self._mark_blocks:
            ret.append('# end of class %(klass)s')
        ret += ((['', 'package main;', '', 'unless(caller){'] + gettext1) + ['%(tab)smy $%(name)s = %(klass)s->new();', '%(tab)s$%(name)s->MainLoop();', '}', ''])
    else:
        ret = ((['1;', '', 'package main;', '%(pl_import)s', 'unless(caller){'] + gettext1) + ['%(tab)slocal *Wx::App::OnInit = sub{1};', '%(tab)smy $%(name)s = Wx::App->new();', '%(tab)sWx::InitAllImageHandlers();', '', '%(tab)smy $%(top_win)s = %(top_win_class)s->new();', '', '%(tab)s$%(name)s->SetTopWindow($%(top_win)s);', '%(tab)s$%(top_win)s->Show(1);', '%(tab)s$%(name)s->MainLoop();', '}', ''])
    return '\n'.join(ret)
build template string for application
def _get_app_template(self, app, top_win):
    
    if (not self.app_name):
        return None
    klass = app.klass
    if self._use_gettext:
        gettext1 = ['%(tab)smy $local = Wx::Locale->new("English", "en", "en"); # replace with ??', '%(tab)s$local->AddCatalog("%(textdomain)s"); # replace with the appropriate catalog name\n']
    else:
        gettext1 = []
    if klass:
        ret = ['package %(klass)s;', , 'use base qw(Wx::App);', 'use strict;', '%(pl_import)s', 'sub OnInit {', '%(tab)smy( $self ) = shift;', , '%(tab)sWx::InitAllImageHandlers();', , '%(tab)smy $%(top_win)s = %(top_win_class)s->new();', , '%(tab)s$self->SetTopWindow($%(top_win)s);', '%(tab)s$%(top_win)s->Show(1);', , '%(tab)sreturn 1;', '}']
        if self._mark_blocks:
            ret.append('# end of class %(klass)s')
        ret += (([, 'package main;', , 'unless(caller){'] + gettext1) + ['%(tab)smy $%(name)s = %(klass)s->new();', '%(tab)s$%(name)s->MainLoop();', '}', ])
    else:
        ret = ((['1;', , 'package main;', '%(pl_import)s', 'unless(caller){'] + gettext1) + ['%(tab)slocal *Wx::App::OnInit = sub{1};', '%(tab)smy $%(name)s = Wx::App->new();', '%(tab)sWx::InitAllImageHandlers();', , '%(tab)smy $%(top_win)s = %(top_win_class)s->new();', , '%(tab)s$%(name)s->SetTopWindow($%(top_win)s);', '%(tab)s$%(top_win)s->Show(1);', '%(tab)s$%(name)s->MainLoop();', '}', ])
    return '\n'.join(ret)