Exemple #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)
Exemple #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)
Exemple #3
0
 def runTest(self):
     for anchor, expected in self.tests.iteritems():
         actual = get_section_start_end(self.lines, anchor)
         self.assertEqual(actual, expected)
Exemple #4
0
 def runTest(self):
     for anchor, expected in self.tests.iteritems():
         actual = get_section_start_end(self.lines, anchor)
         self.assertEqual(actual, expected)