Ejemplo n.º 1
0
 def _extract_list(self, cells):
     var = Variable('', [self.GetCellValue(*cell) for cell in cells], '')
     dlg = ListVariableDialog(
         self._controller.datafile_controller.variables, var, self._plugin)
     if dlg.ShowModal() == wx.ID_OK:
         name, value = dlg.get_value()
         comment = dlg.get_comment()
         self._execute(ExtractList(name, value, comment, cells))
Ejemplo n.º 2
0
 def _extract_scalar(self, cell):
     var = Variable('', self.GetCellValue(*cell), '')
     dlg = ScalarVariableDialog(
         self._controller.datafile_controller.variables, var)
     if dlg.ShowModal() == wx.ID_OK:
         name, value = dlg.get_value()
         comment = dlg.get_comment()
         self._execute(ExtractScalar(name, value, comment, cell))
 def _variable_plugin(self):
     return FakePlugin(self._registered_editors,
                       VariableController(VariableTableController(
                           self._datafile_controller(), None), Variable('','')))
 def setUp(self):
     self._var = Variable('${steve}', 'val')
     self._var_ctrl = VariableController(object(), self._var)
 def test_comment_variable(self):
     self.assertTrue(self._var_ctrl.has_data())
     self.assertFalse(VariableController(object(), Variable('','')).has_data())
 def test_is_not_equal_to_some_other(self):
     self.assertFalse(self._var_ctrl == VariableController(object(), Variable('${other}', 'foo')))