python-statemachine 3.2.1__py3-none-any.whl → 3.2.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
statemachine/factory.py CHANGED
@@ -5,6 +5,8 @@ from . import registry
5
5
  from .callbacks import CallbackGroup
6
6
  from .callbacks import CallbackPriority
7
7
  from .callbacks import CallbackSpecList
8
+ from .callbacks import SpecReference
9
+ from .callbacks import is_unbounded_reference
8
10
  from .event import Event
9
11
  from .event import _expand_event_id
10
12
  from .exceptions import InvalidDefinition
@@ -13,12 +15,25 @@ from .graph import iterate_states
13
15
  from .graph import iterate_states_and_transitions
14
16
  from .graph import states_without_path_to_final_states
15
17
  from .i18n import _
18
+ from .spec_parser import names_in_boolean_expr
16
19
  from .state import State
17
20
  from .states import States
18
21
  from .transition import Transition
19
22
  from .transition_list import TransitionList
20
23
 
21
24
 
25
+ def _same_callable(func: Any, other: Any) -> bool:
26
+ return type(func) is type(other) and func == other
27
+
28
+
29
+ def _can_store_apart(existing: Any, owners: list[tuple[State, Any]]) -> bool:
30
+ """Only callbacks held by object can move to a key of their own: a name is still
31
+ reachable through ``self.<name>``, so it must not lose a plain method or attribute."""
32
+ return all(is_unbounded_reference(func) for _, func in owners) and (
33
+ existing is None or isinstance(existing, Event) or is_unbounded_reference(existing)
34
+ )
35
+
36
+
22
37
  class StateMachineMetaclass(type):
23
38
  "Metaclass for constructing StateMachine classes"
24
39
 
@@ -51,7 +66,7 @@ class StateMachineMetaclass(type):
51
66
  cls._abstract = True
52
67
  cls._events: dict[Event, None] = {} # used Dict to preserve order and avoid duplicates
53
68
  cls._protected_attrs: set = set()
54
- cls._events_to_update: dict[Event, Event | None] = {}
69
+ cls._events_to_update: dict[Event, list[Event]] = {}
55
70
  cls._specs = CallbackSpecList()
56
71
  cls.prepare = cls._specs.grouper(CallbackGroup.PREPARE).add(
57
72
  "prepare_event", priority=CallbackPriority.GENERIC, is_convention=True
@@ -59,7 +74,6 @@ class StateMachineMetaclass(type):
59
74
  cls.add_inherited(bases)
60
75
  cls.add_from_attributes(attrs)
61
76
  cls._collect_class_listeners(attrs, bases)
62
- cls._unpack_builders_callbacks()
63
77
  cls._update_event_references()
64
78
 
65
79
  if not cls.states:
@@ -88,6 +102,7 @@ class StateMachineMetaclass(type):
88
102
 
89
103
  cls._check()
90
104
  cls._setup()
105
+ cls._unpack_builders_callbacks(attrs)
91
106
  cls._expand_docstring()
92
107
 
93
108
  _STATECHART_RE = re.compile(r"\{statechart:(\w+)\}")
@@ -163,14 +178,96 @@ class StateMachineMetaclass(type):
163
178
  if not any(t for t in parent.transitions if t.initial and t.target == state):
164
179
  parent.to(state, initial=True) # pragma: no cover
165
180
 
166
- def _unpack_builders_callbacks(cls):
167
- callbacks = {}
181
+ def _unpack_builders_callbacks(cls, attrs: dict[str, Any]):
182
+ names_resolved_by_name = cls._names_resolved_by_name()
183
+ relocated: dict[Any, str] = {}
184
+ for attr_name, owners in cls._nested_callbacks().items():
185
+ existing = cls.__dict__.get(attr_name)
186
+ owners = [(s, f) for s, f in owners if not _same_callable(f, existing)]
187
+ if not owners:
188
+ continue
189
+ if existing is None and len(owners) == 1:
190
+ setattr(cls, attr_name, owners[0][1])
191
+ continue
192
+ if attr_name in names_resolved_by_name or not _can_store_apart(existing, owners):
193
+ cls._raise_callback_collision(attr_name, existing, owners, attrs)
194
+ for state, func in owners:
195
+ relocated[func] = f"{state.id}:{attr_name}"
196
+ setattr(cls, relocated[func], func)
197
+ own_states = [value for value in attrs.values() if isinstance(value, State)]
198
+ cls._update_lookup_names(relocated, own_states)
199
+
200
+ def _nested_callbacks(cls) -> dict[str, list[tuple[State, Any]]]:
201
+ """Distinct callables declared under each name, with the state body declaring them."""
202
+ claims: dict[str, list[tuple[State, Any]]] = {}
168
203
  for state in iterate_states(cls.states):
169
204
  if state._callbacks:
170
- callbacks.update(state._callbacks)
171
- del state._callbacks
172
- for key, value in callbacks.items():
173
- setattr(cls, key, value)
205
+ for attr_name, func in state._callbacks.items():
206
+ owners = claims.setdefault(attr_name, [])
207
+ if not any(_same_callable(func, other) for _, other in owners):
208
+ owners.append((state, func))
209
+ state._callbacks = None
210
+ return claims
211
+
212
+ def _update_lookup_names(cls, relocated: dict[Any, str], own_states: list[State]):
213
+ """Inherited states share their specs with the base class, which must keep its own."""
214
+ if not relocated:
215
+ return
216
+ for visited in iterate_states_and_transitions(own_states):
217
+ for spec in visited._specs:
218
+ if spec.reference is SpecReference.CALLABLE and spec.func in relocated:
219
+ spec.lookup_name = relocated[spec.func]
220
+
221
+ def _all_specs(cls):
222
+ yield cls._specs
223
+ for visited in iterate_states_and_transitions(cls.states):
224
+ yield visited._specs
225
+
226
+ def _names_resolved_by_name(cls) -> set[str]:
227
+ names: set[str] = set()
228
+ for specs in cls._all_specs():
229
+ for spec in specs:
230
+ if spec.may_contain_boolean_expression:
231
+ names.update(names_in_boolean_expr(spec.attr_name))
232
+ elif spec.reference is SpecReference.NAME:
233
+ names.add(spec.attr_name)
234
+ return names
235
+
236
+ def _raise_callback_collision(
237
+ cls,
238
+ attr_name: str,
239
+ existing: Any,
240
+ owners: list[tuple[State, Any]],
241
+ attrs: dict[str, Any],
242
+ ):
243
+ class_body_names = set(attrs)
244
+ class_body_names.update(
245
+ value.attr_name for value in attrs.values() if getattr(value, "attr_name", None)
246
+ )
247
+ state, func = owners[0]
248
+ if existing is None:
249
+ conflict = _("is declared in both the '{}' and the '{}' state bodies").format(
250
+ state.id, owners[1][0].id
251
+ )
252
+ elif isinstance(existing, Event):
253
+ conflict = _("in the '{}' state body clashes with the event '{}'").format(
254
+ state.id, existing.id
255
+ )
256
+ elif attr_name in class_body_names:
257
+ conflict = _("is declared in both the '{}' state body and the '{}' class body").format(
258
+ state.id, cls.__name__
259
+ )
260
+ else:
261
+ conflict = _("in the '{}' state body clashes with the '{}' attribute of '{}'").format(
262
+ state.id, attr_name, cls.__name__
263
+ )
264
+ name = func.__name__ if getattr(func, "is_event", False) else attr_name
265
+ raise InvalidDefinition(
266
+ _(
267
+ "Callback '{}' {}. Nested state bodies share the class namespace. "
268
+ "Rename one of them."
269
+ ).format(name, conflict)
270
+ )
174
271
 
175
272
  def _check(cls):
176
273
  has_states = bool(cls.states)
@@ -305,21 +402,21 @@ class StateMachineMetaclass(type):
305
402
  if isinstance(value, State):
306
403
  cls.add_state(key, value)
307
404
  elif isinstance(value, (Transition, TransitionList)):
308
- event_id = _expand_event_id(key)
309
- cls.add_event(event=Event(transitions=value, id=event_id))
405
+ for event_id in _expand_event_id(key):
406
+ cls.add_event(event=Event(transitions=value, id=event_id))
310
407
  elif isinstance(value, (Event,)):
311
- if value._has_real_id:
312
- event_id = value.id
313
- else:
314
- event_id = _expand_event_id(key)
315
- new_event = Event(
316
- transitions=value._transitions,
317
- id=event_id,
318
- name=value.name,
319
- )
320
- cls.add_event(event=new_event, old_event=value)
408
+ event_ids = [value.id] if value._has_real_id else _expand_event_id(key)
409
+ for event_id in event_ids:
410
+ new_event = Event(
411
+ transitions=value._transitions,
412
+ id=event_id,
413
+ name=value.name,
414
+ delay=value.delay,
415
+ internal=value.internal,
416
+ )
417
+ cls.add_event(event=new_event, old_event=value)
321
418
  # Ensure the event is accessible by the Python attribute name
322
- if event_id != key:
419
+ if key not in event_ids:
323
420
  setattr(cls, key, new_event)
324
421
  elif getattr(value, "attr_name", None):
325
422
  cls._add_unbounded_callback(key, value)
@@ -334,7 +431,8 @@ class StateMachineMetaclass(type):
334
431
  # machinery that is stored at ``func.attr_name``
335
432
  setattr(cls, func.attr_name, func)
336
433
  if func.is_event:
337
- cls.add_event(event=Event(func._transitions, id=attr_name))
434
+ for event_id in _expand_event_id(attr_name):
435
+ cls.add_event(event=Event(func._transitions, id=event_id))
338
436
 
339
437
  def add_state(cls, id, state: State):
340
438
  state._set_id(id)
@@ -357,8 +455,7 @@ class StateMachineMetaclass(type):
357
455
  old_event: "Event | None" = None,
358
456
  ):
359
457
  if not event._has_real_id:
360
- if event not in cls._events_to_update:
361
- cls._events_to_update[event] = None
458
+ cls._events_to_update.setdefault(event, [])
362
459
  return
363
460
 
364
461
  transitions = event._transitions
@@ -370,20 +467,20 @@ class StateMachineMetaclass(type):
370
467
  setattr(cls, event.id, event)
371
468
 
372
469
  if old_event is not None:
373
- cls._events_to_update[old_event] = event
470
+ cls._events_to_update.setdefault(old_event, []).append(event)
374
471
 
375
472
  return cls._events[event]
376
473
 
377
474
  def _update_event_references(cls):
378
- for old_event, new_event in cls._events_to_update.items():
475
+ for old_event, new_events in cls._events_to_update.items():
379
476
  for state in cls.states:
380
477
  for transition in state.transitions:
381
- if transition._events.match(old_event):
382
- if new_event is None:
478
+ if old_event in transition._events:
479
+ if not new_events:
383
480
  raise InvalidDefinition(
384
481
  _("An event in the '{}' has no id.").format(transition)
385
482
  )
386
- transition.events._replace(old_event, new_event)
483
+ transition.events._replace(old_event, new_events)
387
484
 
388
485
  cls._events_to_update = {}
389
486
 
@@ -17,6 +17,7 @@ from uuid import uuid4
17
17
 
18
18
  from ..event import BoundEvent
19
19
  from ..event import Event
20
+ from ..event import raise_delayed_internal
20
21
  from ..statemachine import StateChart
21
22
  from .evaluators import Evaluator
22
23
  from .evaluators import protected_attrs
@@ -400,6 +401,9 @@ def create_send_action_callable( # noqa: C901
400
401
  ) -> Callable:
401
402
  content: Any = ()
402
403
  _valid_targets = (None, "#_internal", "internal", "#_parent", "parent")
404
+ internal = action.target in ("#_internal", "internal")
405
+ if internal and (action.delay or action.delayexpr):
406
+ raise_delayed_internal(action.event or action.eventexpr or "")
403
407
  if action.content:
404
408
  content = (evaluator.eval_literal(action.content),)
405
409
  delay_expr = (
@@ -433,8 +437,6 @@ def create_send_action_callable( # noqa: C901
433
437
  _send_to_parent(action, evaluator, **kwargs)
434
438
  return
435
439
 
436
- internal = target in ("#_internal", "internal")
437
-
438
440
  send_id = None
439
441
  if action.id:
440
442
  send_id = action.id
@@ -117,7 +117,14 @@
117
117
  "params": { "type": "array", "items": { "$ref": "#/$defs/param" } },
118
118
  "content": { "type": "string" }
119
119
  },
120
- "additionalProperties": false
120
+ "additionalProperties": false,
121
+ "if": {
122
+ "required": ["target"],
123
+ "properties": { "target": { "enum": ["#_internal", "internal"] } }
124
+ },
125
+ "then": {
126
+ "not": { "anyOf": [{ "required": ["delay"] }, { "required": ["delayexpr"] }] }
127
+ }
121
128
  },
122
129
  "foreach": {
123
130
  "type": "object",
@@ -5,7 +5,7 @@ msgid ""
5
5
  msgstr ""
6
6
  "Project-Id-Version: 3.1.1\n"
7
7
  "Report-Msgid-Bugs-To: fgmacedo@gmail.com\n"
8
- "POT-Creation-Date: 2026-06-16 23:00-0300\n"
8
+ "POT-Creation-Date: 2026-10-13 21:26-0300\n"
9
9
  "PO-Revision-Date: 2026-02-24 14:31-0300\n"
10
10
  "Last-Translator: Fernando Macedo <fgmacedo@gmail.com>\n"
11
11
  "Language: en\n"
@@ -16,7 +16,7 @@ msgstr ""
16
16
  "Content-Transfer-Encoding: 8bit\n"
17
17
  "Generated-By: Babel 2.18.0\n"
18
18
 
19
- #: statemachine/callbacks.py:398 statemachine/callbacks.py:403
19
+ #: statemachine/callbacks.py:409 statemachine/callbacks.py:414
20
20
  #, python-brace-format
21
21
  msgid "Did not found name '{}' from model or statemachine"
22
22
  msgstr "Did not found name '{}' from model or statemachine"
@@ -29,12 +29,20 @@ msgstr ""
29
29
  "There's no current state set. In async code, did you activate the initial"
30
30
  " state? (e.g., `await sm.activate_initial_state()`)"
31
31
 
32
- #: statemachine/dispatcher.py:123
32
+ #: statemachine/dispatcher.py:127
33
33
  #, python-brace-format
34
34
  msgid "Failed to parse boolean expression '{}'"
35
35
  msgstr "Failed to parse boolean expression '{}'"
36
36
 
37
- #: statemachine/event.py:94
37
+ #: statemachine/event.py:56
38
+ #, python-brace-format
39
+ msgid ""
40
+ "Event {id!r} cannot be both delayed and internal: the internal queue runs"
41
+ " within the current macrostep, which takes no time. Drop 'internal' to "
42
+ "deliver it later on the external queue, or drop 'delay' to run it now."
43
+ msgstr ""
44
+
45
+ #: statemachine/event.py:108
38
46
  #, python-brace-format
39
47
  msgid ""
40
48
  "Event() received a non-string 'id' ({cls_name}). To combine multiple "
@@ -43,12 +51,12 @@ msgstr ""
43
51
  "Event() received a non-string 'id' ({cls_name}). To combine multiple "
44
52
  "transitions under one event, use the | operator: t1 | t2."
45
53
 
46
- #: statemachine/event.py:130
54
+ #: statemachine/event.py:147
47
55
  #, python-brace-format
48
56
  msgid "Cannot add callback '{}' to an event with no transitions."
49
57
  msgstr "Cannot add callback '{}' to an event with no transitions."
50
58
 
51
- #: statemachine/event.py:163
59
+ #: statemachine/event.py:182
52
60
  #, python-brace-format
53
61
  msgid "Event {} cannot be called without a SM instance"
54
62
  msgstr "Event {} cannot be called without a SM instance"
@@ -63,7 +71,7 @@ msgstr "{!r} is not a valid state value."
63
71
  msgid "Can't {} when in {}."
64
72
  msgstr "Can't {} when in {}."
65
73
 
66
- #: statemachine/factory.py:77
74
+ #: statemachine/factory.py:91
67
75
  #, python-brace-format
68
76
  msgid ""
69
77
  "There should be one and only one initial state. Your currently have "
@@ -72,7 +80,34 @@ msgstr ""
72
80
  "There should be one and only one initial state. Your currently have "
73
81
  "these: {0}"
74
82
 
75
- #: statemachine/factory.py:194
83
+ #: statemachine/factory.py:249
84
+ #, python-brace-format
85
+ msgid "is declared in both the '{}' and the '{}' state bodies"
86
+ msgstr ""
87
+
88
+ #: statemachine/factory.py:253
89
+ #, python-brace-format
90
+ msgid "in the '{}' state body clashes with the event '{}'"
91
+ msgstr ""
92
+
93
+ #: statemachine/factory.py:257
94
+ #, python-brace-format
95
+ msgid "is declared in both the '{}' state body and the '{}' class body"
96
+ msgstr ""
97
+
98
+ #: statemachine/factory.py:261
99
+ #, python-brace-format
100
+ msgid "in the '{}' state body clashes with the '{}' attribute of '{}'"
101
+ msgstr ""
102
+
103
+ #: statemachine/factory.py:267
104
+ #, python-brace-format
105
+ msgid ""
106
+ "Callback '{}' {}. Nested state bodies share the class namespace. Rename "
107
+ "one of them."
108
+ msgstr ""
109
+
110
+ #: statemachine/factory.py:291
76
111
  #, python-brace-format
77
112
  msgid ""
78
113
  "There should be one and only one initial state. You currently have these:"
@@ -81,12 +116,12 @@ msgstr ""
81
116
  "There should be one and only one initial state. You currently have these:"
82
117
  " {!r}"
83
118
 
84
- #: statemachine/factory.py:209
119
+ #: statemachine/factory.py:306
85
120
  #, python-brace-format
86
121
  msgid "Cannot declare transitions from final state. Invalid state(s): {}"
87
122
  msgstr "Cannot declare transitions from final state. Invalid state(s): {}"
88
123
 
89
- #: statemachine/factory.py:221
124
+ #: statemachine/factory.py:318
90
125
  #, python-brace-format
91
126
  msgid ""
92
127
  "All non-final states should have at least one outgoing transition. These "
@@ -95,7 +130,7 @@ msgstr ""
95
130
  "All non-final states should have at least one outgoing transition. These "
96
131
  "states have no outgoing transition: {!r}"
97
132
 
98
- #: statemachine/factory.py:235
133
+ #: statemachine/factory.py:332
99
134
  #, python-brace-format
100
135
  msgid ""
101
136
  "All non-final states should have at least one path to a final state. "
@@ -104,7 +139,7 @@ msgstr ""
104
139
  "All non-final states should have at least one path to a final state. "
105
140
  "These states have no path to a final state: {!r}"
106
141
 
107
- #: statemachine/factory.py:248
142
+ #: statemachine/factory.py:345
108
143
  #, python-brace-format
109
144
  msgid ""
110
145
  "There are unreachable states. The statemachine graph should have a single"
@@ -113,7 +148,7 @@ msgstr ""
113
148
  "There are unreachable states. The statemachine graph should have a single"
114
149
  " component. Disconnected states: {}"
115
150
 
116
- #: statemachine/factory.py:285
151
+ #: statemachine/factory.py:382
117
152
  #, python-brace-format
118
153
  msgid ""
119
154
  "Invalid entry in 'listeners': {!r}. Expected a class, callable, or "
@@ -122,7 +157,7 @@ msgstr ""
122
157
  "Invalid entry in 'listeners': {!r}. Expected a class, callable, or "
123
158
  "listener instance."
124
159
 
125
- #: statemachine/factory.py:384
160
+ #: statemachine/factory.py:481
126
161
  #, python-brace-format
127
162
  msgid "An event in the '{}' has no id."
128
163
  msgstr "An event in the '{}' has no id."
@@ -132,15 +167,15 @@ msgstr "An event in the '{}' has no id."
132
167
  msgid "{!r} is not a valid state machine name."
133
168
  msgstr "{!r} is not a valid state machine name."
134
169
 
135
- #: statemachine/state.py:249
170
+ #: statemachine/state.py:273
136
171
  msgid "'donedata' can only be specified on final states."
137
172
  msgstr "'donedata' can only be specified on final states."
138
173
 
139
- #: statemachine/statemachine.py:167
174
+ #: statemachine/statemachine.py:168
140
175
  msgid "There are no states or transitions."
141
176
  msgstr "There are no states or transitions."
142
177
 
143
- #: statemachine/statemachine.py:237
178
+ #: statemachine/statemachine.py:242
144
179
  #, python-brace-format
145
180
  msgid "State overriding is not allowed. Trying to add '{}' to {}"
146
181
  msgstr "State overriding is not allowed. Trying to add '{}' to {}"
@@ -158,3 +193,9 @@ msgstr ""
158
193
  #, python-brace-format
159
194
  msgid "{} only supports the decorator syntax to register callbacks."
160
195
  msgstr "{} only supports the decorator syntax to register callbacks."
196
+
197
+ #: statemachine/engines/async_.py:50
198
+ msgid ""
199
+ "The task running the processing loop was cancelled while it processed "
200
+ "this event."
201
+ msgstr ""
@@ -5,7 +5,7 @@ msgid ""
5
5
  msgstr ""
6
6
  "Project-Id-Version: 3.1.1\n"
7
7
  "Report-Msgid-Bugs-To: fgmacedo@gmail.com\n"
8
- "POT-Creation-Date: 2026-06-16 23:00-0300\n"
8
+ "POT-Creation-Date: 2026-10-13 21:26-0300\n"
9
9
  "PO-Revision-Date: 2024-06-07 17:41-0300\n"
10
10
  "Last-Translator: Fernando Macedo <fgmacedo@gmail.com>\n"
11
11
  "Language: hi_IN\n"
@@ -16,7 +16,7 @@ msgstr ""
16
16
  "Content-Transfer-Encoding: 8bit\n"
17
17
  "Generated-By: Babel 2.18.0\n"
18
18
 
19
- #: statemachine/callbacks.py:398 statemachine/callbacks.py:403
19
+ #: statemachine/callbacks.py:409 statemachine/callbacks.py:414
20
20
  #, python-brace-format
21
21
  msgid "Did not found name '{}' from model or statemachine"
22
22
  msgstr "मॉडल या स्टेटमशीन में नाम '{}' नहीं मिला"
@@ -29,12 +29,24 @@ msgstr ""
29
29
  "कोई वर्तमान स्टेट सेट नहीं है। असिंक्रोनस कोड में, क्या आपने प्रारंभिक "
30
30
  "स्टेट को सक्रिय किया? (उदाहरण: `await sm.activate_initial_state()`)"
31
31
 
32
- #: statemachine/dispatcher.py:123
32
+ #: statemachine/dispatcher.py:127
33
33
  #, python-brace-format
34
34
  msgid "Failed to parse boolean expression '{}'"
35
35
  msgstr "बूलियन अभिव्यक्ति '{}' को पार्स करने में विफल रहा"
36
36
 
37
- #: statemachine/event.py:94
37
+ #: statemachine/event.py:56
38
+ #, python-brace-format
39
+ msgid ""
40
+ "Event {id!r} cannot be both delayed and internal: the internal queue runs"
41
+ " within the current macrostep, which takes no time. Drop 'internal' to "
42
+ "deliver it later on the external queue, or drop 'delay' to run it now."
43
+ msgstr ""
44
+ "इवेंट {id!r} एक साथ विलंबित और आंतरिक नहीं हो सकता: आंतरिक कतार वर्तमान "
45
+ "मैक्रोस्टेप के भीतर चलती है, जिसमें कोई समय नहीं लगता। इसे बाद में बाहरी "
46
+ "कतार से भेजने के लिए 'internal' हटाएँ, या इसे अभी चलाने के लिए 'delay' "
47
+ "हटाएँ।"
48
+
49
+ #: statemachine/event.py:108
38
50
  #, python-brace-format
39
51
  msgid ""
40
52
  "Event() received a non-string 'id' ({cls_name}). To combine multiple "
@@ -43,12 +55,12 @@ msgstr ""
43
55
  "Event() को एक गैर-स्ट्रिंग 'id' ({cls_name}) मिला। एक ही इवेंट के तहत कई "
44
56
  "ट्रांज़िशन को जोड़ने के लिए, | ऑपरेटर का उपयोग करें: t1 | t2।"
45
57
 
46
- #: statemachine/event.py:130
58
+ #: statemachine/event.py:147
47
59
  #, python-brace-format
48
60
  msgid "Cannot add callback '{}' to an event with no transitions."
49
61
  msgstr "बिना ट्रांज़िशन वाले इवेंट में कॉलबैक '{}' नहीं जोड़ सकते।"
50
62
 
51
- #: statemachine/event.py:163
63
+ #: statemachine/event.py:182
52
64
  #, python-brace-format
53
65
  msgid "Event {} cannot be called without a SM instance"
54
66
  msgstr "इवेंट {} को SM इंस्टेंस के बिना कॉल नहीं किया जा सकता"
@@ -63,14 +75,43 @@ msgstr "{!r} एक मान्य स्टेट मान नहीं ह
63
75
  msgid "Can't {} when in {}."
64
76
  msgstr "{} स्थिति में {} नहीं कर सकते।"
65
77
 
66
- #: statemachine/factory.py:77
78
+ #: statemachine/factory.py:91
67
79
  #, python-brace-format
68
80
  msgid ""
69
81
  "There should be one and only one initial state. Your currently have "
70
82
  "these: {0}"
71
83
  msgstr "एक और केवल एक प्रारंभिक स्टेट होना चाहिए। वर्तमान में आपके पास ये हैं: {0}"
72
84
 
73
- #: statemachine/factory.py:194
85
+ #: statemachine/factory.py:249
86
+ #, python-brace-format
87
+ msgid "is declared in both the '{}' and the '{}' state bodies"
88
+ msgstr "'{}' और '{}' दोनों स्टेट बॉडी में घोषित है"
89
+
90
+ #: statemachine/factory.py:253
91
+ #, python-brace-format
92
+ msgid "in the '{}' state body clashes with the event '{}'"
93
+ msgstr "'{}' स्टेट बॉडी में इवेंट '{}' से टकराता है"
94
+
95
+ #: statemachine/factory.py:257
96
+ #, python-brace-format
97
+ msgid "is declared in both the '{}' state body and the '{}' class body"
98
+ msgstr "'{}' स्टेट बॉडी और '{}' क्लास बॉडी दोनों में घोषित है"
99
+
100
+ #: statemachine/factory.py:261
101
+ #, python-brace-format
102
+ msgid "in the '{}' state body clashes with the '{}' attribute of '{}'"
103
+ msgstr "'{0}' स्टेट बॉडी में '{2}' के एट्रिब्यूट '{1}' से टकराता है"
104
+
105
+ #: statemachine/factory.py:267
106
+ #, python-brace-format
107
+ msgid ""
108
+ "Callback '{}' {}. Nested state bodies share the class namespace. Rename "
109
+ "one of them."
110
+ msgstr ""
111
+ "कॉलबैक '{}' {}। नेस्टेड स्टेट बॉडी क्लास का नेमस्पेस साझा करती हैं। इनमें"
112
+ " से एक का नाम बदलें।"
113
+
114
+ #: statemachine/factory.py:291
74
115
  #, python-brace-format
75
116
  msgid ""
76
117
  "There should be one and only one initial state. You currently have these:"
@@ -79,12 +120,12 @@ msgstr ""
79
120
  "एक और केवल एक प्रारंभिक स्टेट होना चाहिए। वर्तमान में आपके पास ये हैं: "
80
121
  "{!r}"
81
122
 
82
- #: statemachine/factory.py:209
123
+ #: statemachine/factory.py:306
83
124
  #, python-brace-format
84
125
  msgid "Cannot declare transitions from final state. Invalid state(s): {}"
85
126
  msgstr "अंतिम स्टेट से ट्रांज़िशन घोषित नहीं कर सकते। अमान्य स्टेट: {}"
86
127
 
87
- #: statemachine/factory.py:221
128
+ #: statemachine/factory.py:318
88
129
  #, python-brace-format
89
130
  msgid ""
90
131
  "All non-final states should have at least one outgoing transition. These "
@@ -93,7 +134,7 @@ msgstr ""
93
134
  "सभी गैर-अंतिम स्टेट में कम से कम एक आउटगोइंग ट्रांज़िशन होना चाहिए। इन "
94
135
  "स्टेट में कोई आउटगोइंग ट्रांज़िशन नहीं है: {!r}"
95
136
 
96
- #: statemachine/factory.py:235
137
+ #: statemachine/factory.py:332
97
138
  #, python-brace-format
98
139
  msgid ""
99
140
  "All non-final states should have at least one path to a final state. "
@@ -102,7 +143,7 @@ msgstr ""
102
143
  "सभी गैर-अंतिम स्टेट में अंतिम स्टेट तक कम से कम एक पथ होना चाहिए। इन "
103
144
  "स्टेट में अंतिम स्टेट तक कोई पथ नहीं है: {!r}"
104
145
 
105
- #: statemachine/factory.py:248
146
+ #: statemachine/factory.py:345
106
147
  #, python-brace-format
107
148
  msgid ""
108
149
  "There are unreachable states. The statemachine graph should have a single"
@@ -111,7 +152,7 @@ msgstr ""
111
152
  "कुछ स्टेट पहुंच योग्य नहीं हैं। स्टेटमशीन ग्राफ में एक ही घटक होना चाहिए।"
112
153
  " डिस्कनेक्टेड स्टेट: {}"
113
154
 
114
- #: statemachine/factory.py:285
155
+ #: statemachine/factory.py:382
115
156
  #, python-brace-format
116
157
  msgid ""
117
158
  "Invalid entry in 'listeners': {!r}. Expected a class, callable, or "
@@ -120,7 +161,7 @@ msgstr ""
120
161
  "'listeners' में अमान्य प्रविष्टि: {!r}। एक क्लास, कॉलेबल, या लिसनर "
121
162
  "इंस्टेंस अपेक्षित है।"
122
163
 
123
- #: statemachine/factory.py:384
164
+ #: statemachine/factory.py:481
124
165
  #, python-brace-format
125
166
  msgid "An event in the '{}' has no id."
126
167
  msgstr "'{}' में एक इवेंट का आईडी नहीं है।"
@@ -130,15 +171,15 @@ msgstr "'{}' में एक इवेंट का आईडी नहीं
130
171
  msgid "{!r} is not a valid state machine name."
131
172
  msgstr "{!r} एक मान्य स्टेटमशीन नाम नहीं है।"
132
173
 
133
- #: statemachine/state.py:249
174
+ #: statemachine/state.py:273
134
175
  msgid "'donedata' can only be specified on final states."
135
176
  msgstr "'donedata' केवल अंतिम स्टेट पर निर्दिष्ट किया जा सकता है।"
136
177
 
137
- #: statemachine/statemachine.py:167
178
+ #: statemachine/statemachine.py:168
138
179
  msgid "There are no states or transitions."
139
180
  msgstr "कोई स्टेट या ट्रांज़िशन नहीं हैं।"
140
181
 
141
- #: statemachine/statemachine.py:237
182
+ #: statemachine/statemachine.py:242
142
183
  #, python-brace-format
143
184
  msgid "State overriding is not allowed. Trying to add '{}' to {}"
144
185
  msgstr ""
@@ -159,6 +200,14 @@ msgstr ""
159
200
  msgid "{} only supports the decorator syntax to register callbacks."
160
201
  msgstr "{} केवल कॉलबैक रजिस्टर करने के लिए डेकोरेटर सिंटैक्स का समर्थन करता है।"
161
202
 
203
+ #: statemachine/engines/async_.py:50
204
+ msgid ""
205
+ "The task running the processing loop was cancelled while it processed "
206
+ "this event."
207
+ msgstr ""
208
+ "प्रोसेसिंग लूप चलाने वाला टास्क इस इवेंट को प्रोसेस करते समय रद्द कर दिया"
209
+ " गया।"
210
+
162
211
  #~ msgid "There are no states."
163
212
  #~ msgstr "कोई स्टेट नहीं है।"
164
213