Initialize room

This commit is contained in:
Joscha 2016-05-08 00:01:48 +02:00
parent a0bd6b71bf
commit 4314fa60f3
3 changed files with 35 additions and 5 deletions

View file

@ -1,3 +1,6 @@
from .connection import Connection from .connection import Connection
from .session import Session from .session import Session
from .message import Message from .message import Message
from .sessions import Sessions
from .messages import Messages
from .room import Room

View file

@ -1,9 +1,37 @@
import connection from . import connection
from . import messages
from . import sessions
class Room(): class Room():
""" """
TODO Connects to and provides more abstract access to a room on euphoria.
""" """
def __init__(self): def __init__(self, room, nick=None, password=None, account_email=None, account_password=None):
self.messages = [] """
room - name of the room to connect to
nick - nick to assume, None -> no nick
password - room password (in case the room is private)
account_email - email of your account
account_password - password of your account
"""
self.room = room
self.nick = nick
self.password = password
self.account_email = account_email
self.account_password = account_password
self.messages = messages.Messages()
self.sessions = sessions.Sessions()
self.con = connection.Connection(self.room)
def launch(self):
"""
launch() -> Thread
Open connection in a new thread (see connection.Connection.launch).
"""
return self.con.launch()

View file

@ -99,4 +99,3 @@ class Session():
""" """
return self.staff and True or False return self.staff and True or False