primitive.py 698 B

1234567891011121314151617181920
  1. '''This file is part of AToMPM - A Tool for Multi-Paradigm Modelling
  2. Copyright 2011 by the AToMPM team and licensed under the LGPL
  3. See COPYING.lesser and README.md in the root of this project for full details'''
  4. import uuid
  5. # Abstract class
  6. class Primitive(object):
  7. def __init__(self):
  8. self.is_success = False # flags weather the primitive's action resulted in a success or not
  9. self.exception = None # holds the exception object if one was raised
  10. self._id = uuid.uuid4()
  11. def cancelIn(self, cancel):
  12. self.is_success = False
  13. self.exception = None
  14. def __str__(self):
  15. return '%s %s' % (str(self.__class__.__name__), self._id)