Exemplo n.º 1
0
 def test_overwrite(self):
     ctrl = TestCaseFileController(TestCaseFile(source=self._filepath).populate(),
                                   create_project())
     os.utime(self._filepath, (1,1))
     assert_true(ctrl.has_been_modified_on_disk())
     ctrl.execute(SaveFile())
     assert_false(ctrl.has_been_modified_on_disk())
Exemplo n.º 2
0
 def save(self, controller=None):
     if controller is None:
         controller = self.get_selected_datafile_controller()
     if controller is not None:
         if not controller.has_format():
             self._show_dialog_for_files_without_format(controller)
         else:
             controller.execute(SaveFile())
Exemplo n.º 3
0
 def change_format(self, controller, format):
     if controller.is_same_format(format):
         return
     old_path = controller.filename
     controller.set_format(format)
     controller.execute(SaveFile())
     if old_path:
         self._remove_file(old_path)
         RideFileNameChanged(old_filename=old_path,
                             datafile=controller).publish()
Exemplo n.º 4
0
 def _show_warning(self, msg_lines, ctrl, yes_handler):
     if ctrl.dirty:
         msg_lines.insert(2,
                          'Answering <Yes> will discard unsaved changes.')
     msg_lines.extend(['', 'Changed file is:', ctrl.datafile.source])
     ret = wx.MessageBox('\n'.join(msg_lines),
                         'File Changed On Disk',
                         style=wx.YES_NO | wx.ICON_WARNING)
     if ret == wx.NO:
         from robotide.controller.ctrlcommands import SaveFile
         ctrl.execute(SaveFile())
         return True
     if ret == wx.YES:
         yes_handler()
     return False
Exemplo n.º 5
0
 def save(self):
     if self._skip:
         return
     command = SaveFile()
     print('suite.execute(%s)' % str(command))
     self._suite.execute(command)
 def _create_resource(self):
     self.new_resource = self.ctrl.execute(
         CreateNewResource(self.res_full_name))
     self.new_resource.execute(AddKeyword(self.new_keyword_name, '${moi}'))
     self.new_resource.execute(SaveFile())