pyrobale.StateMachineΒΆ

ClassesΒΆ

Package ContentsΒΆ

class pyrobale.StateMachine.StateMachine[source]ΒΆ
set_state(user_id, state)[source]ΒΆ

Sets or updates state of a user

Parameters:
  • user_id (string OR integer) – unique id of user for setting the state

  • state (string) – state of user (it can be anything)

get_state(user_id)[source]ΒΆ

Gets state of a specified user

Parameters:

user_id (string OR integer) – unique id of user for getting the state

Returns:

the state of user

Return type:

Str

del_state(user_id)[source]ΒΆ

Deletes the saved state of user

Parameters:

user_id (string OR integer) – unique if of user to delete its state

save_local(file_name)[source]ΒΆ

Saves the state of all users to a file

Parameters:

file_name (string) – name of file to save the state of users

load_local(file_name)[source]ΒΆ

Loads the state of all users from a file

Parameters:

file_name (string) – name of file to load the state of users