wxPython/wxGlade-0.9.1/codegen/__init__.py
def add_app(self, app, top_win):
        """Generates the code for a wxApp instance.
        If the file to write into already exists, this function does nothing.

        If gettext support is requested and there is not template with gettext support but there is a template without
        gettext support, template without gettext support will be used.

        This fallback mechanism works bidirectional.

        L{app_mapping} will be reset to default values and updated with L{lang_mapping}.

        see: tmpl_appfile, tmpl_detailed, tmpl_gettext_detailed, tmpl_simple, tmpl_gettext_simple, app_mapping,
             lang_mapping"""

        if not self.multiple_files:
            prev_src = self.previous_source
        else:
            # overwrite apps file always
            prev_src = None

        # do nothing if the file exists
        if prev_src:
            return

        klass = app.klass

        # top window and application name are mandatory
        if not app.top_window:
            return
        
        # get and fill language dependent template
        tmpl = self._get_app_template(app, top_win)
        if not tmpl: return

        self._app_added = True

        # map to substitute template variables
        self.app_mapping = {'comment_sign': self.comment_sign,
                            'header_lines': ''.join(self.header_lines),
                            'klass': self.cn_class(klass), 'name': self.app_name,
                            'overwrite': self.tmpl_overwrite % {'comment_sign': self.comment_sign},
                            'tab': self.tabs(1),
                            'textdomain': self._textdomain,
                            'top_win_class': self.cn_class(top_win and top_win.klass or None),
                            'top_win_module': top_win and top_win.klass.replace('::', '_'),
                            'top_win': app.top_window }

        # extend default mapping with language specific mapping
        if self.lang_mapping:
            self.app_mapping.update(self.lang_mapping)

        code = tmpl % self.app_mapping

        if self.multiple_files:
            filename = os.path.join(self.out_dir, self.app_filename)
            code = "%s%s" % ( self.tmpl_appfile % self.app_mapping, code )
            # write the wxApp code
            self.save_file(filename, [code], True)
        else:
            self.output_file.append(code)
Generates the code for a wxApp instance.
        If the file to write into already exists, this function does nothing.

        If gettext support is requested and there is not template with gettext support but there is a template without
        gettext support, template without gettext support will be used.

        This fallback mechanism works bidirectional.

        L{app_mapping} will be reset to default values and updated with L{lang_mapping}.

        see: tmpl_appfile, tmpl_detailed, tmpl_gettext_detailed, tmpl_simple, tmpl_gettext_simple, app_mapping,
             lang_mapping
Generates the code for a wxApp instance.
If the file to write into already exists, this function does nothing.

If gettext support is requested and there is not template with gettext support but there is a template without
gettext support, template without gettext support will be used.

This fallback mechanism works bidirectional.

L{app_mapping} will be reset to default values and updated with L{lang_mapping}.


Generates the code for a wxApp instance . If the file to write into already exists this function does nothing . If gettext support is requested and there is not template with gettext support but there is a template without gettext support template without gettext support will be used . This fallback mechanism works bidirectional . L { app_mapping } will be reset to default values and updated with L { lang_mapping } .
def add_app(self, app, top_win):
        if not self.multiple_files:
            prev_src = self.previous_source
        else:
            prev_src = None
        if prev_src:
            return
        klass = app.klass
        if not app.top_window:
            return
        tmpl = self._get_app_template(app, top_win)
        if not tmpl: return
        self._app_added = True
        self.app_mapping = {'comment_sign': self.comment_sign,
                            'header_lines': ''.join(self.header_lines),
                            'klass': self.cn_class(klass), 'name': self.app_name,
                            'overwrite': self.tmpl_overwrite % {'comment_sign': self.comment_sign},
                            'tab': self.tabs(1),
                            'textdomain': self._textdomain,
                            'top_win_class': self.cn_class(top_win and top_win.klass or None),
                            'top_win_module': top_win and top_win.klass.replace('::', '_'),
                            'top_win': app.top_window }
        if self.lang_mapping:
            self.app_mapping.update(self.lang_mapping)
        code = tmpl % self.app_mapping
        if self.multiple_files:
            filename = os.path.join(self.out_dir, self.app_filename)
            code = "%s%s" % ( self.tmpl_appfile % self.app_mapping, code )
            self.save_file(filename, [code], True)
        else:
            self.output_file.append(code)
def add_app ( self , app , top_win ) : if not self . multiple_files : prev_src = self . previous_source else : prev_src = None if prev_src : return klass = app . klass if not app . top_window : return tmpl = self . _get_app_template ( app , top_win ) if not tmpl : return self . _app_added = True self . app_mapping = { 'comment_sign' : self . comment_sign , 'header_lines' : '' . join ( self . header_lines ) , 'klass' : self . cn_class ( klass ) , 'name' : self . app_name , 'overwrite' : self . tmpl_overwrite % { 'comment_sign' : self . comment_sign } , 'tab' : self . tabs ( 1 ) , 'textdomain' : self . _textdomain , 'top_win_class' : self . cn_class ( top_win and top_win . klass or None ) , 'top_win_module' : top_win and top_win . klass . replace ( '::' , '_' ) , 'top_win' : app . top_window } if self . lang_mapping : self . app_mapping . update ( self . lang_mapping ) code = tmpl % self . app_mapping if self . multiple_files : filename = os . path . join ( self . out_dir , self . app_filename ) code = "%s%s" % ( self . tmpl_appfile % self . app_mapping , code ) self . save_file ( filename , [ code ] , True ) else : self . output_file . append ( code )
Generates the code for a wxApp instance.
Generates the code for a wxApp instance .
"""Generates the code for a wxApp instance.
        If the file to write into already exists, this function does nothing.

        If gettext support is requested and there is not template with gettext support but there is a template without
        gettext support, template without gettext support will be used.

        This fallback mechanism works bidirectional.

        L{app_mapping} will be reset to default values and updated with L{lang_mapping}.

        see: tmpl_appfile, tmpl_detailed, tmpl_gettext_detailed, tmpl_simple, tmpl_gettext_simple, app_mapping,
             lang_mapping""" # overwrite apps file always # do nothing if the file exists # top window and application name are mandatory # get and fill language dependent template # map to substitute template variables # extend default mapping with language specific mapping # write the wxApp code
self
app
top_win