def build_untouched_content(self):
    "        Builds a string with the contents of the file that must be left as is,\n        and replaces the wxGlade blocks with tags that in turn will be replaced\n        by the new wxGlade blocks\n\n        WARNING: NOT YET COMPLETE -- crazyinsomniac\n\n        alb - almost done :)\n        WARNING: There is *NO* support for here documents: if you put wxGlade\n        blocks inside a here document, you're likely going into troubles...\n        "
    BaseSourceFileContent.build_untouched_content(self)
    inside_block = False
    inside_pod = False
    tmp_in = self._load_file(self.name)
    out_lines = []
    check_old_methods = []
    for line in tmp_in:
        result = self.rec_pod.match(line)
        if result:
            inside_pod = True
        if inside_pod:
            out_lines.append(line)
            if line.startswith('=cut'):
                inside_pod = False
            continue
        result = self.rec_class_decl.match(line)
        if result:
            if (not self.class_name):
                out_lines.append(('<%swxGlade insert new_classes>' % self.nonce))
                self.new_classes_inserted = True
            self.class_name = result.group(1)
            self.class_name = self.format_classname(self.class_name)
            self.classes.add(self.class_name)
            out_lines.append(line)
        elif (not inside_block):
            result = self.rec_block_start.match(line)
            if result:
                spaces = result.group('spaces')
                which_class = result.group('classname')
                which_block = result.group('block')
                if (not which_class):
                    which_class = self.class_name
                else:
                    which_class = self.format_classname(which_class)
                self.spaces[which_class] = spaces
                inside_block = True
                if (not self.class_name):
                    out_lines.append(('<%swxGlade replace %s>' % (self.nonce, which_block)))
                else:
                    if (which_block in ('__do_layout', '__set_properties')):
                        check_old_methods.append(len(out_lines))
                    out_lines.append(('<%swxGlade replace %s %s>' % (self.nonce, which_class, which_block)))
            else:
                result = self.rec_event_handler.match(line)
                if result:
                    which_handler = result.group('handler')
                    which_class = self.format_classname(result.group('class'))
                    self.event_handlers.setdefault(which_class, set()).add(which_handler)
                if (self.class_name and self.is_end_of_class(line)):
                    out_lines.append(('<%swxGlade event_handlers %s>' % (self.nonce, self.class_name)))
                out_lines.append(line)
        elif self.rec_block_end.match(line):
            inside_block = False
    if (not self.new_classes_inserted):
        out_lines.append(('<%swxGlade insert new_classes>' % self.nonce))
    while check_old_methods:
        i = check_old_methods.pop((- 1))
        if (out_lines[(i + 1)].strip() == '}'):
            self._remove_method(out_lines, (i - 2), (i + 1))
    self.content = out_lines
Builds a string with the contents of the file that must be left as is,
and replaces the wxGlade blocks with tags that in turn will be replaced
by the new wxGlade blocks

WARNING: NOT YET COMPLETE -- crazyinsomniac

alb - almost done :)
WARNING: There is *NO* support for here documents: if you put wxGlade
blocks inside a here document, you're likely going into troubles...
def build_untouched_content(self):
    "        Builds a string with the contents of the file that must be left as is,\n        and replaces the wxGlade blocks with tags that in turn will be replaced\n        by the new wxGlade blocks\n\n        WARNING: NOT YET COMPLETE -- crazyinsomniac\n\n        alb - almost done :)\n        WARNING: There is *NO* support for here documents: if you put wxGlade\n        blocks inside a here document, you're likely going into troubles...\n        "
    BaseSourceFileContent.build_untouched_content(self)
    inside_block = False
    inside_pod = False
    tmp_in = self._load_file(self.name)
    out_lines = []
    check_old_methods = []
    for line in tmp_in:
        result = self.rec_pod.match(line)
        if result:
            inside_pod = True
        if inside_pod:
            out_lines.append(line)
            if line.startswith('=cut'):
                inside_pod = False
            continue
        result = self.rec_class_decl.match(line)
        if result:
            if (not self.class_name):
                out_lines.append(('<%swxGlade insert new_classes>' % self.nonce))
                self.new_classes_inserted = True
            self.class_name = result.group(1)
            self.class_name = self.format_classname(self.class_name)
            self.classes.add(self.class_name)
            out_lines.append(line)
        elif (not inside_block):
            result = self.rec_block_start.match(line)
            if result:
                spaces = result.group('spaces')
                which_class = result.group('classname')
                which_block = result.group('block')
                if (not which_class):
                    which_class = self.class_name
                else:
                    which_class = self.format_classname(which_class)
                self.spaces[which_class] = spaces
                inside_block = True
                if (not self.class_name):
                    out_lines.append(('<%swxGlade replace %s>' % (self.nonce, which_block)))
                else:
                    if (which_block in ('__do_layout', '__set_properties')):
                        check_old_methods.append(len(out_lines))
                    out_lines.append(('<%swxGlade replace %s %s>' % (self.nonce, which_class, which_block)))
            else:
                result = self.rec_event_handler.match(line)
                if result:
                    which_handler = result.group('handler')
                    which_class = self.format_classname(result.group('class'))
                    self.event_handlers.setdefault(which_class, set()).add(which_handler)
                if (self.class_name and self.is_end_of_class(line)):
                    out_lines.append(('<%swxGlade event_handlers %s>' % (self.nonce, self.class_name)))
                out_lines.append(line)
        elif self.rec_block_end.match(line):
            inside_block = False
    if (not self.new_classes_inserted):
        out_lines.append(('<%swxGlade insert new_classes>' % self.nonce))
    while check_old_methods:
        i = check_old_methods.pop((- 1))
        if (out_lines[(i + 1)].strip() == '}'):
            self._remove_method(out_lines, (i - 2), (i + 1))
    self.content = out_lines