Skip to main content

Easy State-Machine for python

from easystate import * import time SPEED = 1

class Starting(State):
def eval(self):

print ‘Starting’ time.sleep(SPEED)

def on_start(self,e):

print “Hello”

def on_finish(self,e):

self.transition(“Listening”)

class Listening(State):

def eval(self):

print ‘Listening’ time.sleep(SPEED) self.raiseEvent(“connect”)

def on_start(self,e):

print “Preparing for listening”

def on_connect(self,e):

self.transition(‘Negotiation’)

class Negotiation(State):
def eval(self):

print ‘checking validity’ time.sleep(SPEED) print ‘authenticating’ time.sleep(SPEED) print ‘registering’ self.transition(“Connected”)

def on_start(self,e):

print ‘Negotiating’

class Connected(State):
def eval(self):

print ‘Connected’

def on_finish(self,e):

self.transition(“Listening”)

m = StateMachine(initialState=”Starting”) m.appendState(Starting()) m.appendState(Listening()) m.appendState(Negotiation()) m.appendState(Connected()) m.start()

Metadata

Release files for easystate 0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for easystate 0.3
File Size Uploaded Provenance
easystate-0.3.tar.gz 2.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for easystate 0.3
File Interpreter ABI Platform
easystate-0.3-py2.7.egg Legacy Egg format - - Details

Total release size: 7.9 kB

Release files / easystate-0.3.tar.gz

Download URL easystate-0.3.tar.gz
Size 2.7 kB
Tags Source
SHA-256 checksum
How to use checksums
179bea5419370329d005c3983dca22c80d84581d85924f54265b5a05a22f6f7b
BLAKE2b-256 checksum
How to use checksums
8f256ca78f73f596abcd857dfe6ad7d003b8c7f99cf11d01fad30f5a94aa3d65
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / easystate-0.3-py2.7.egg

Download URL easystate-0.3-py2.7.egg
Size 5.1 kB
Tags Egg
SHA-256 checksum
How to use checksums
984f18f712fe6937eeb13ab3cda115c1114a4f8dc4c7c9c10b75414a39344996
BLAKE2b-256 checksum
How to use checksums
dda4b9e48408d28ecc132e72ad82ccccd88ede362e3846d972b6ace14af5f4b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for easystate 0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page