Skip to content

Basic support for inheritance (based on #247) - #253

Merged
fgmacedo merged 3 commits into
developfrom
rschrader-develop
Jan 23, 2020
Merged

fgmacedo merged 3 commits into
developfrom
rschrader-develop

Conversation

@fgmacedo

@fgmacedo fgmacedo commented Jan 21, 2020 •

Copy link
Copy Markdown
Owner

PR based on #247.

Copy states and transitions from base classes.

TODO:

  • Changes on states/transitions on inherited classes should not affect parent classes.

schra061 and others added 2 commits October 19, 2019 17:23
When defining states and transitions in a base class, they are not
detected by the sub class. Therefore The StateMachinMetaClass is
extended to also take care of the states and transitions of the base
classes

Issue: #211
@codecov

codecov Bot commented Jan 21, 2020 •

Copy link
Copy Markdown

Codecov Report

Merging #253 into develop will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff           @@
##           develop   #253   +/-   ##
======================================
  Coverage      100%   100%           
======================================
  Files            5      5           
  Lines          332    344   +12     
  Branches        43     45    +2     
======================================
+ Hits           332    344   +12
Impacted Files Coverage Δ
statemachine/statemachine.py 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 847d28d...7ba183e. Read the comment docs.

Comment thread statemachine/statemachine.py Outdated

def __contribute_to_class__(self, managed, identifier):
self.managed = managed
def _set_identifier(self, identifier):

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

managed was a reference to the statemachine class when the State or Transition was defined. Removed as there's no real use-case and can generate conflict with a State now being used on multiple classes due to inheritance.

@fgmacedo
fgmacedo merged commit 3126005 into develop Jan 23, 2020
@fgmacedo
fgmacedo deleted the rschrader-develop branch January 23, 2020 02:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant