wxPython/wxGlade-0.9.1/codegen/__init__.py
def _source_warning(self, klass, msg, sub_obj):
        """Format and add a warning message to the source code.
        
        The message msg will be split into single lines and every line will be properly formatted.
        
        @param klass: Instance of L{ClassLines} to add the code in
        @param msg:   Multiline message
        
        @param sub_obj: Object to generate code for (CodeObject instance)
        
        @see: L{_format_comment()}"""
        code_lines = []

        # add leading empty line
        code_lines.append('\n')

        # add a leading "WARNING:" to the message
        if not msg.upper().startswith(_('WARNING:')):
            msg = "%s %s" % (_('WARNING:'), msg)

        # add message text
        for line in msg.split('\n'):
            code_lines.append( "%s\n" % self._format_comment(line.rstrip()) )

        # add tailing empty line
        code_lines.append('\n')

        # Add warning message to source code
        # TODO: Remove next three lines after C++ code gen uses dependencies like Python, Perl and Lisp
        if self.language == 'C++':
            klass.init.extend(code_lines)
        else:
            klass.deps.append((sub_obj, sub_obj.parent))
            klass.child_order.append(sub_obj)
            klass.init_lines[sub_obj] = code_lines
Format and add a warning message to the source code.
        
        The message msg will be split into single lines and every line will be properly formatted.
        
        @param klass: Instance of L{ClassLines} to add the code in
        @param msg:   Multiline message
        
        @param sub_obj: Object to generate code for (CodeObject instance)
        
        @see: L{_format_comment()}
Format and add a warning message to the source code.
The message msg will be split into single lines and every line will be properly formatted.
Format and add a warning message to the source code . The message msg will be split into single lines and every line will be properly formatted .
def _source_warning(self, klass, msg, sub_obj):
        code_lines = []
        code_lines.append('\n')
        if not msg.upper().startswith(_('WARNING:')):
            msg = "%s %s" % (_('WARNING:'), msg)
        for line in msg.split('\n'):
            code_lines.append( "%s\n" % self._format_comment(line.rstrip()) )
        code_lines.append('\n')
        if self.language == 'C++':
            klass.init.extend(code_lines)
        else:
            klass.deps.append((sub_obj, sub_obj.parent))
            klass.child_order.append(sub_obj)
            klass.init_lines[sub_obj] = code_lines
def _source_warning ( self , klass , msg , sub_obj ) : code_lines = [ ] code_lines . append ( '\n' ) if not msg . upper ( ) . startswith ( _ ( 'WARNING:' ) ) : msg = "%s %s" % ( _ ( 'WARNING:' ) , msg ) for line in msg . split ( '\n' ) : code_lines . append ( "%s\n" % self . _format_comment ( line . rstrip ( ) ) ) code_lines . append ( '\n' ) if self . language == 'C++' : klass . init . extend ( code_lines ) else : klass . deps . append ( ( sub_obj , sub_obj . parent ) ) klass . child_order . append ( sub_obj ) klass . init_lines [ sub_obj ] = code_lines
Format and add a warning message to the source code.
Format and add a warning message to the source code .
"""Format and add a warning message to the source code.
        
        The message msg will be split into single lines and every line will be properly formatted.
        
        @param klass: Instance of L{ClassLines} to add the code in
        @param msg:   Multiline message
        
        @param sub_obj: Object to generate code for (CodeObject instance)
        
        @see: L{_format_comment()}""" # add leading empty line # add a leading "WARNING:" to the message # add message text # add tailing empty line # Add warning message to source code # TODO: Remove next three lines after C++ code gen uses dependencies like Python, Perl and Lisp
self
klass
Instance of L{ClassLines} to add the code in
Instance of L { ClassLines } to add the code in
msg
None
sub_obj
Object to generate code for (CodeObject instance)
Object to generate code for ( CodeObject instance )
see
None