Skip to content

Commit

Permalink
improve resolve_callback documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
aleneum committed Jun 18, 2018
1 parent f60bc72 commit 82aa5d5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions transitions/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1006,9 +1006,10 @@ def callback(self, func, event_data):

@staticmethod
def resolve_callable(func, event_data):
""" Converts path to a callable into callable
""" Converts a model's method name or a path to a callable into a callable.
If func is not a string it will be returned unaltered.
Args:
func (string, callable): Path to a callable
func (string, callable): Method name or a path to a callable
event_data (EventData): Currently processed event
Returns:
callable function resolved from string or func
Expand All @@ -1025,7 +1026,7 @@ def resolve_callable(func, event_data):
func = getattr(m, name)
except (ImportError, AttributeError, ValueError):
raise AttributeError("Callable with name '%s' could neither be retrieved from the passed "
"model nor imported from a module.")
"model nor imported from a module." % func)
return func

def _has_state(self, state):
Expand Down

0 comments on commit 82aa5d5

Please sign in to comment.