hcoopmeetbotlogic.meeting

Meeting state.

Module Contents

class hcoopmeetbotlogic.meeting.EventType

Bases: str, enum.Enum

Legal event types for TrackedEvent.

START_MEETING = 'START_MEETING'
END_MEETING = 'END_MEETING'
ATTENDEE = 'ATTENDEE'
MEETING_NAME = 'MEETING_NAME'
TOPIC = 'TOPIC'
ADD_CHAIR = 'ADD_CHAIR'
REMOVE_CHAIR = 'REMOVE_CHAIR'
TRACK_NICK = 'TRACK_NICK'
UNDO = 'UNDO'
SAVE_MEETING = 'SAVE_MEETING'
MOTION = 'MOTION'
VOTE = 'VOTE'
ACCEPTED = 'ACCEPTED'
INCONCLUSIVE = 'INCONCLUSIVE'
FAILED = 'FAILED'
ACTION = 'ACTION'
INFO = 'INFO'
IDEA = 'IDEA'
HELP = 'HELP'
class hcoopmeetbotlogic.meeting.VotingAction

Bases: str, enum.Enum

Voting actions

IN_FAVOR = '+1'
OPPOSED = '-1'
class hcoopmeetbotlogic.meeting.TrackedMessage

A message tracked as part of a meeting.

id

Message identifier

Type:

str

sender

IRC nick of the sender

Type:

str

payload

Payload of the message

Type:

str

action

Whether this is an ACTION message

Type:

bool

timestamp

Message timestamp in UTC

Type:

datetime

id: str
sender: str
payload: str
action: bool
timestamp: datetime.datetime
display_name() str

Get the message display name.

class hcoopmeetbotlogic.meeting.TrackedEvent

An event tracked as part of a meeting, always tied to a specific message.

id

The event identifier

Type:

str

event_type

Type of the event

Type:

EventType

timestamp

Event timestamp in UTC

Type:

datetime

message

The message associated with the event

Type:

TrackedMessage

operand

The operand (remainder of the payload after the command)

Type:

Optional[str]

event_type: EventType
message: TrackedMessage
operand: Any | None
id: str
timestamp: datetime.datetime
display_name() str

Get the event display name.

class hcoopmeetbotlogic.meeting.Meeting

A meeting on a particular IRC channel.

The meeting can be serialized and deserialized to and from JSON. This is the mechanism we use to persist the raw log to disk. If you round trip the JSON (generate JSON and then use that JSON to create a new meeting), the resulting object contains data that is equivalent, but not exactly identical to, the original object. Each tracked event has an associated message. In the original object, the tracked event always refers to one of the message objects that is already in the messages list. When you deserialize from JSON, the object in the message list will be different than the one on the tracked event, although they will be equivalent by value. So, if you deserialize from JSON, it’s best to treat the resulting object as a read-only copy. The copy won’t always work exactly like a meeting that was created at runtime based on actual IRC traffic.

id

Unique identifier for the meeting

Type:

str

name

The name of the meeting, which defaults to the channel name

Type:

str

founder

IRC nick of the meeting founder, always a member of chairs

Type:

str

channel

Channel the meeting is running on

Type:

str

network

Network associated with the channel

Type:

str

chair

IRC nick of primary meeting chair, always a member of chairs

Type:

str

chairs

IRC nick of all meeting chairs, including the primary

Type:

List[str]

nicks

IRC nick of anyone who contributed to the meeting or was explicitly called out

Type:

List[str]

start_time

Start time of the meeting in UTC

Type:

datetime

end_time

End time of the meeting in UTC, possibly None

Type:

Optional[datetime]

original_topic

The original topic assigned to the channel prior to starting the meeting

Type:

Optional[str]

current_topic

The current topic, assigned by a chair

Type:

Optional[str]

messages

List of all messages tracked as part of the meeting

Type:

List[TrackedMessage]

events

List of all events tracked as part of the meeting

Type:

List[TrackedEvent]

aliases

Dictionary mapping attendee IRC nick to optional alias

Type:

Dict[str, Optional[str]

vote_in_progress

Whether voting is in progress

Type:

bool

motion_index

Index into events for the current motion, when voting is in progress

Type:

int

founder: str
channel: str
network: str
id: str
name: str
chair: str
chairs: List[str]
nicks: Dict[str, int]
start_time: datetime.datetime
end_time: datetime.datetime | None
active: bool = False
original_topic: str | None
current_topic: str | None
messages: List[TrackedMessage]
events: List[TrackedEvent]
aliases: Dict[str, str | None]
vote_in_progress: bool = False
motion_index: int | None
static meeting_key(channel: str, network: str) str

Build the dict key for a network and channel.

to_json() str

Serialize a meeting to JSON.

static from_json(data: str) Meeting

Deserialize a meeting from JSON.

key() str
display_name() str

Get the meeting display name.

add_chair(nick: str, primary: bool = True) None

Add a chair to a meeting, potentially making it the primary chair.

remove_chair(nick: str) None

Remove a chair from a meeting, ignoring requests to remove the founder.

is_chair(nick: str) bool

Whether a nickname is a chair for the meeting

track_attendee(nick: str, alias: str | None = None) None

Track an IRC nick as a meeting attendee, optionally assigning an alias.

track_nick(nick: str, messages: int = 1) None

Track an IRC nick, incrementing its count of messages as indicated

track_message(message: hcoopmeetbotlogic.interface.Message) TrackedMessage

Track a message associated with the meeting.

track_event(event_type: EventType, message: TrackedMessage, operand: Any | None = None) TrackedEvent

Track an event associated with a meeting.

pop_event() TrackedEvent | None

Pop the last tracked event off the list of events, if possible, returning the event.