Remove kwarg default_start_state in the machine constructor
The usage of 'default_start_state' via the machine constructor is deprecated usage of the 'default_start_state' property setter is recommended. And there is no usage of default_start_state as constructor argument in other projects [1]. It's safe to remove it now. [1] http://codesearch.openstack.org/?q=default_start_state&i=nope&files=&repos= Change-Id: I454d453d513ae670ddd664d1d8b20ecf8d1202dd
This commit is contained in:
parent
718a313831
commit
f620f2aa87
@ -14,7 +14,6 @@
|
||||
|
||||
import collections
|
||||
|
||||
from debtcollector import removals
|
||||
import prettytable
|
||||
import six
|
||||
|
||||
@ -102,16 +101,10 @@ class FiniteMachine(object):
|
||||
return cls.Effect(new_state['reactions'].get(event),
|
||||
new_state["terminal"])
|
||||
|
||||
@removals.removed_kwarg('default_start_state',
|
||||
message="The usage of 'default_start_state' via"
|
||||
" the machine constructor is deprecated and will"
|
||||
" be removed in a future version; usage of"
|
||||
" the 'default_start_state' property setter is"
|
||||
" recommended.")
|
||||
def __init__(self, default_start_state=None):
|
||||
def __init__(self):
|
||||
self._transitions = {}
|
||||
self._states = collections.OrderedDict()
|
||||
self._default_start_state = default_start_state
|
||||
self._default_start_state = None
|
||||
self._current = None
|
||||
self.frozen = False
|
||||
|
||||
@ -460,9 +453,8 @@ class HierarchicalFiniteMachine(FiniteMachine):
|
||||
Effect = collections.namedtuple('Effect',
|
||||
'reaction,terminal,machine')
|
||||
|
||||
def __init__(self, default_start_state=None):
|
||||
super(HierarchicalFiniteMachine, self).__init__(
|
||||
default_start_state=default_start_state)
|
||||
def __init__(self):
|
||||
super(HierarchicalFiniteMachine, self).__init__()
|
||||
self._nested_machines = {}
|
||||
|
||||
@classmethod
|
||||
|
@ -8,8 +8,5 @@ pbr!=2.1.0,>=2.0.0 # Apache-2.0
|
||||
# Python 2->3 compatibility library.
|
||||
six>=1.9.0 # MIT
|
||||
|
||||
# For deprecation of things
|
||||
debtcollector>=1.2.0 # Apache-2.0
|
||||
|
||||
# For pretty formatting machines/state tables...
|
||||
PrettyTable<0.8,>=0.7.1 # BSD
|
||||
|
Loading…
x
Reference in New Issue
Block a user