示例#1
0
    def load_section_content(self, anchor_name):
        """
        This is a really shitty way of doing inline editing, but all the other
        possibilities have been explored and this is the least shitty of them
        all.
        """
        content = self.load_content()
        # Go through the content, looking for headers
        lines = content.splitlines()
        start, end = get_section_start_end(lines, anchor_name)
        section = '\n'.join(lines[start:end])

        return (section, start, end)
示例#2
0
    def load_section_content(self, anchor_name):
        """
        This is a really shitty way of doing inline editing, but all the other
        possibilities have been explored and this is the least shitty of them
        all.
        """
        content = self.load_content()
        # Go through the content, looking for headers
        lines = content.splitlines()
        start, end = get_section_start_end(lines, anchor_name)
        section = '\n'.join(lines[start:end])

        return (section, start, end)
示例#3
0
 def runTest(self):
     for anchor, expected in self.tests.iteritems():
         actual = get_section_start_end(self.lines, anchor)
         self.assertEqual(actual, expected)
示例#4
0
 def runTest(self):
     for anchor, expected in self.tests.iteritems():
         actual = get_section_start_end(self.lines, anchor)
         self.assertEqual(actual, expected)