Exemplo n.º 1
0
 def split_requested(self, name, loc):
     self.commit_all_editors_to_container()
     self.add_savepoint(_('Split %s') % self.gui.elided_text(name))
     try:
         bottom_name = split(current_container(), name, loc)
     except AbortError:
         self.rewind_savepoint()
         raise
     self.apply_container_update_to_gui()
     self.edit_file(bottom_name, 'html')
Exemplo n.º 2
0
 def split_requested(self, name, loc):
     self.commit_all_editors_to_container()
     self.add_savepoint(_('Split %s') % self.gui.elided_text(name))
     try:
         bottom_name = split(current_container(), name, loc)
     except AbortError:
         self.rewind_savepoint()
         raise
     self.apply_container_update_to_gui()
     self.edit_file(bottom_name, 'html')
Exemplo n.º 3
0
 def test_split_file(self):
     " Test splitting of files "
     book = get_split_book()
     c = get_container(book)
     name = "index.html"
     nname = split(c, name, '//*[@id="page2"]')
     root = c.parsed(nname)
     troot = c.parsed(name)
     self.assertEqual(1, len(root.xpath('//*[@id="container"]')), "Split point was not adjusted")
     self.assertEqual(0, len(troot.xpath('//*[@id="container"]')), "Split point was not adjusted")
     self.check_links(c)
Exemplo n.º 4
0
 def test_split_file(self):
     ' Test splitting of files '
     book = get_split_book()
     c = get_container(book)
     name = 'index.html'
     nname = split(c, name, '//*[@id="page2"]')
     root = c.parsed(nname)
     troot = c.parsed(name)
     self.assertEqual(1, len(root.xpath('//*[@id="container"]')), 'Split point was not adjusted')
     self.assertEqual(0, len(troot.xpath('//*[@id="container"]')), 'Split point was not adjusted')
     self.check_links(c)
Exemplo n.º 5
0
 def split_requested(self, name, loc):
     if not self.check_dirtied():
         return
     QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
     try:
         self.add_savepoint(_('Split %s') % self.gui.elided_text(name))
         try:
             bottom_name = split(current_container(), name, loc)
         except AbortError:
             self.rewind_savepoint()
             raise
         self.apply_container_update_to_gui()
         self.edit_file(bottom_name, 'html')
     finally:
         QApplication.restoreOverrideCursor()