Robot Framework Integrated Development Environment (RIDE)
messages.py
Go to the documentation of this file.
1 # Copyright 2008-2015 Nokia Networks
2 # Copyright 2016- Robot Framework Foundation
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 # http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 
16 import inspect
17 import sys
18 import traceback
19 from .. import utils
20 
21 from robotide import utils
22 
23 
24 
38 
39 
42  _topic = None
43  data = []
44 
45 
52  def __init__(self, **kwargs):
53  if sorted(kwargs.keys()) != sorted(self.datadata):
54  raise TypeError('Argument mismatch, expected: %s' % self.datadata)
55  self.__dict__.update(kwargs)
56 
57  @classmethod
58  def topic(cls):
59  if not cls._topic_topic:
60  cls_name = cls.__name__
61  if cls_name.endswith('Message'):
62  cls_name = cls_name[:-len('Message')]
63  topic_name = utils.printable_name(cls_name, code_style=True).replace(' ', '.')
64  else:
65  topic_name = cls._topic_topic
66  return topic_name.lower()
67 
68 
77  def publish(self):
78  from robotide.publish.publisher import PUBLISHER
79  PUBLISHER.publish(self.__class__, self)
80 
81 
82 
88  data = ['message', 'level', 'timestamp', 'notify_user']
89 
90 
91 
97  data = ['message', 'level', 'timestamp', 'notify_user']
98 
99 
104  def __init__(self, message, level='INFO', notify_user=False):
105  RideMessage.__init__(
106  self, message=message, level=level,
107  timestamp=utils.get_timestamp(), notify_user=notify_user)
108 
109 
110 
118  data = ['message', 'level', 'timestamp', 'exception', 'notify_user']
119 
120 
126  def __init__(self, message, exception, level='INFO', notify_user=False):
127  exc_type, exc_value, exc_traceback = sys.exc_info()
128  if exc_traceback:
129  tb = traceback.extract_tb(exc_traceback)
130  message += '\n\nTraceback (most recent call last):\n%s\n%s' % \
131  (str(exception), ''.join(traceback.format_list(tb)))
132  RideMessage.__init__(
133  self, message=message, level=level, notify_user=notify_user,
134  timestamp=utils.get_timestamp(), exception=exception)
135 
136 
137 
143  data = ['message', 'level', 'timestamp', 'notify_user']
144 
145 
150  def __init__(self, message, level='', notify_user=False):
151  RideMessage.__init__(
152  self, message=message, level=level,
153  timestamp=utils.get_timestamp(), notify_user=notify_user)
154 
155 
156 
158  data = ['message']
159 
160 
161 
163  data = ['controller']
164 
165 
166 
174  data = ['keys', 'old', 'new']
175 
176 
177 
179 
180 
181 
182 class RideTreeSelection(RideMessage):
183  data = ['node', 'item', 'silent']
184 
185 
186 
188  data = ['controller']
189 
190 
191 
193  data = ['results']
194 
195 
196 
198  data = ['tests']
199 
200 
201 
203  data = ['item']
204 
205 
206 
208  data = ['item']
209 
210 
211 
213  data = ['item']
214 
215 
216 
218  data = ['item']
219 
220 
221 
223  data = ['item']
224 
225 
226 
228  data = ['item']
229 
230 
231 
237  data = ['oldtab', 'newtab']
238 
239 
240 
242  pass
243 
244 
245 
249 class RideSaving(RideMessage):
250  data = ['path', 'datafile']
251 
252 
253 
255  pass
256 
257 
258 
260  data = ['path']
261 
262 
263 
265  pass
266 
267 
268 
273  data = ['datafile']
274 
275 
276 
278  data = ['path', 'datafile']
279 
280 
281 
283  pass
284 
285 
286 
287 class RideOpenSuite(RideMessage):
288  data = ['path', 'datafile']
289 
290 
291 
293  data = ['path', 'datafile']
294 
295 
296 
298  data = ['item']
299 
300 
301 
303  pass
304 
305 
306 
307 class RideFileNameChanged(RideDataChanged):
308  data = ['datafile', 'old_filename']
309 
310 
312  data = ['path', 'datafile']
313 
314 
316  data = ['parent', 'suite']
317 
318 
320  data = ['path', 'datafile']
321 
322 
323 
325  data = ['datafile', 'type', 'import_controller']
326 
327  def is_resource(self):
328  return self.typetype == 'resource'
329 
330  @property
331  name = property
332 
333  def name(self):
334  return self.import_controller.name
335 
336 
338  data = ['old_controller', 'new_controller']
339 
340 
342  pass
343 
344 
345 class RideExcludesChanged(_RideExcludes):
346  pass
347 
348 
349 
355  pass
356 
357 
358 
364  pass
365 
366 
367 
373  pass
374 
375 
376 
378  data = ['datafile']
379 
380 
381 
384  data = ['item']
385 
386 
387 
389  pass
390 
391 
392 
393 class RideUserKeywordAdded(RideUserKeyword):
394  data = ['datafile', 'name', 'item']
395 
396 
397 
399  data = ['datafile', 'name', 'item']
400 
401 
402 
404  data = ['item']
405 
406 
408  """"""
409  pass
410 
411 
412 class RideItemNameChanged(RideItem):
413  """"""
414  data = ['item', 'old_name']
415 
416 
418  """"""
419  pass
420 
421 
422 
424  data = ['datafile', 'name', 'item']
425 
426 
427 
429  data = ['datafile', 'name', 'item']
430 
431 
432 
434  data = ['item']
435 
436 
437 
439  data = ['item']
440 
441 
442 
444  data = ['datafile', 'name', 'item', 'index']
445 
446 
447 
449  data = ['datafile', 'name', 'item']
450 
451 
452 
457  data = ['item', 'other']
458 
459 
460 
465  data = ['item', 'other']
466 
467 
468 
470  data = ['item']
471 
472 
473 
475  data = ['includes', 'excludes']
476 
477 
479  data = ['plugin']
480 
481 
482 __all__ = [name for name, cls in globals().items()
483  if inspect.isclass(cls) and issubclass(cls, RideMessage)]
Sent before files are going to be saved.
Definition: messages.py:254
Sent when user selects Quit from File menu or via shortcut.
Definition: messages.py:282
Sent when datafile changes from serialized version.
Definition: messages.py:377
Base class for all messages notifying that data in model has changed.
Definition: messages.py:302
Sent when datafiles dirty marking is cleared.
Definition: messages.py:272
Set when a whole datafile is replaced with new one in a controller.
Definition: messages.py:383
Sent whenever spec xml import is requested.
Definition: messages.py:178
Sent whenever an import setting is added.
Definition: messages.py:354
Sent whenever a value of import setting is changed.
Definition: messages.py:363
Sent whenever a value of import setting is removed.
Definition: messages.py:372
Base class for all messages about changes to import settings.
Definition: messages.py:324
Sent whenever user input is invalid.
Definition: messages.py:157
Sent when an item (test, keyword, variable) is moved down.
Definition: messages.py:438
Sent when an item (test, keyword, variable) is moved up.
Definition: messages.py:433
Base class for all messages about changes to any data item.
Definition: messages.py:403
This class represents a general purpose log message with a traceback appended to message text.
Definition: messages.py:117
def __init__(self, message, exception, level='INFO', notify_user=False)
Initializes a RIDE log exception.
Definition: messages.py:126
This class represents a general purpose log message.
Definition: messages.py:96
def __init__(self, message, level='INFO', notify_user=False)
Initializes a RIDE log message.
Definition: messages.py:104
This class represents a general purpose log message.
Definition: messages.py:87
Base class for all messages sent by RIDE.
Definition: messages.py:37
def __init__(self, **kwargs)
Initializes message based on given keyword arguments.
Definition: messages.py:52
def publish(self)
Publishes the message.
Definition: messages.py:77
Sent whenever modifying command is prevented for some reason.
Definition: messages.py:162
Sent when a new project has been created.
Definition: messages.py:277
Sent after the notebook tab change has completed.
Definition: messages.py:241
Sent when the notebook tab change has started.
Definition: messages.py:236
Sent when a new resource has finished loading.
Definition: messages.py:292
Sent we when want to open Search Tags)
Definition: messages.py:474
Sent when variable dialog is requested to be open.
Definition: messages.py:187
This class represents a general purpose log message.
Definition: messages.py:142
def __init__(self, message, level='', notify_user=False)
Initializes a RIDE log message.
Definition: messages.py:150
Sent when user selects Save All from File menu or via shortcut.
Definition: messages.py:264
Sent after the file has been actually saved to disk.
Definition: messages.py:259
Sent when a resource should be selected.
Definition: messages.py:297
Sent when settings are changed.
Definition: messages.py:173
Sent when a new test case is added to a suite.
Definition: messages.py:423
Sent when a test case is removed from a suite.
Definition: messages.py:428
Sent whenever new test execution is started.
Definition: messages.py:192
Sent whenever RIDE has executed a test case, and it failed.
Definition: messages.py:217
Sent whenever RIDE has executed a test case, and it passed.
Definition: messages.py:212
Sent whenever RIDE is running a test case and paused.
Definition: messages.py:207
Sent whenever RIDE is starting to run a test case.
Definition: messages.py:202
Sent whenever a test is selected or unselected from the tree.
Definition: messages.py:197
Sent whenever RIDE has executed a test case, and it was skipped.
Definition: messages.py:222
Sent whenever RIDE was executing a test case, and it was stopped or aborted.
Definition: messages.py:227
Sent when a user keyword is removed from a suite or resource.
Definition: messages.py:398
Base class for all messages about changes to any user keyword.
Definition: messages.py:388
Sent when a new variable is added to a suite.
Definition: messages.py:443
Sent when a variable is moved down item is the item that has been moved down other is the item that w...
Definition: messages.py:464
Sent when a variable is moved up item is the item that has been moved up other is the item that was s...
Definition: messages.py:456
Sent when a variable is removed from a suite.
Definition: messages.py:448
Sent when the state of a variable is changed.
Definition: messages.py:469