From f620f2aa8722375c44ad5025e3ee1c64709eaf14 Mon Sep 17 00:00:00 2001 From: "ChangBo Guo(gcb)" Date: Tue, 22 Aug 2017 14:05:16 +0800 Subject: [PATCH] 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 --- automaton/machines.py | 16 ++++------------ requirements.txt | 3 --- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/automaton/machines.py b/automaton/machines.py index 6a9d3b5..f57d313 100644 --- a/automaton/machines.py +++ b/automaton/machines.py @@ -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 diff --git a/requirements.txt b/requirements.txt index 35f7353..93fb9e8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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