solid
Advanced tools
+40
-1
| Metadata-Version: 1.0 | ||
| Name: solid | ||
| Version: 0.1.1 | ||
| Version: 0.1.2 | ||
| Summary: Pythonic state machines | ||
@@ -11,2 +11,3 @@ Home-page: http://github.com/haaksmash/solid | ||
| ===== | ||
| A state machine implementation for Python --- which *isn't* solely designed to parse strings! | ||
@@ -17,2 +18,3 @@ | ||
| ------------------ | ||
| They're cool! Also, easy to reason about --- a state machine design enables you | ||
@@ -24,2 +26,3 @@ to compartmentalize responsibilites in a way that functions simply don't. | ||
| ------------ | ||
| It's a convoluted name: it's a state machine library written in python; | ||
@@ -29,4 +32,40 @@ snake is another word for python that sounds like state --- and Solid Snake is | ||
| hello, world | ||
| ------------ | ||
| Let's define a super-simple state machine with two states: one that prints | ||
| "Hello" and one that prints "World": | ||
| :: | ||
| from solid.machines import BaseMachine | ||
| from solid.states import BaseState, is_entry_state | ||
| from solid.transition import to | ||
| class HelloMachine(BaseMachine): | ||
| @is_entry_state | ||
| class Hello(BaseState): | ||
| def body(self): | ||
| print "Hello" | ||
| return to(HelloMachine.World) | ||
| class World(BaseState): | ||
| def body(self): | ||
| print "World" | ||
| From an intertpreter (or whatever): | ||
| :: | ||
| >>> h = HelloMachine() | ||
| >>> h.start() | ||
| Hello | ||
| World | ||
| >>> | ||
| and that's pretty much all there is to it. | ||
| Platform: UNKNOWN |
+4
-0
| solid | ||
| ===== | ||
| A state machine implementation for Python --- which *isn't* solely designed to parse strings! | ||
@@ -8,2 +9,3 @@ | ||
| ------------------ | ||
| They're cool! Also, easy to reason about --- a state machine design enables you | ||
@@ -15,2 +17,3 @@ to compartmentalize responsibilites in a way that functions simply don't. | ||
| ------------ | ||
| It's a convoluted name: it's a state machine library written in python; | ||
@@ -22,2 +25,3 @@ snake is another word for python that sounds like state --- and Solid Snake is | ||
| ------------ | ||
| Let's define a super-simple state machine with two states: one that prints | ||
@@ -24,0 +28,0 @@ "Hello" and one that prints "World": |
+1
-1
@@ -28,3 +28,3 @@ #!/usr/bin/env python | ||
| name="solid", | ||
| version='0.1.1', | ||
| version='0.1.2', | ||
| description="Pythonic state machines", | ||
@@ -31,0 +31,0 @@ long_description=open("README.txt").read(), |
| Metadata-Version: 1.0 | ||
| Name: solid | ||
| Version: 0.1.1 | ||
| Version: 0.1.2 | ||
| Summary: Pythonic state machines | ||
@@ -11,2 +11,3 @@ Home-page: http://github.com/haaksmash/solid | ||
| ===== | ||
| A state machine implementation for Python --- which *isn't* solely designed to parse strings! | ||
@@ -17,2 +18,3 @@ | ||
| ------------------ | ||
| They're cool! Also, easy to reason about --- a state machine design enables you | ||
@@ -24,2 +26,3 @@ to compartmentalize responsibilites in a way that functions simply don't. | ||
| ------------ | ||
| It's a convoluted name: it's a state machine library written in python; | ||
@@ -29,4 +32,40 @@ snake is another word for python that sounds like state --- and Solid Snake is | ||
| hello, world | ||
| ------------ | ||
| Let's define a super-simple state machine with two states: one that prints | ||
| "Hello" and one that prints "World": | ||
| :: | ||
| from solid.machines import BaseMachine | ||
| from solid.states import BaseState, is_entry_state | ||
| from solid.transition import to | ||
| class HelloMachine(BaseMachine): | ||
| @is_entry_state | ||
| class Hello(BaseState): | ||
| def body(self): | ||
| print "Hello" | ||
| return to(HelloMachine.World) | ||
| class World(BaseState): | ||
| def body(self): | ||
| print "World" | ||
| From an intertpreter (or whatever): | ||
| :: | ||
| >>> h = HelloMachine() | ||
| >>> h.start() | ||
| Hello | ||
| World | ||
| >>> | ||
| and that's pretty much all there is to it. | ||
| Platform: UNKNOWN |
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
30622
6.83%