Ejemplo n.º 1
0
    'sass/main.scss',
    filters='pyscss',
    depends=('**/*.scss'),
    output='styles.css')
assets.register('scss_all', scss)


# Globals
users = {}
rooms = Channels()

# Initalize channels
rooms.add_channel('general')
msg = {'text': 'Welcome to channel #general',
       'name': 'FlackBot', 'stamp': now_stamp(), 'color': cObj('#888888')}
rooms.add_message('general', msg)


@app.route("/")
def index():
    """Show chat app"""
    return render_template('index.html')


@app.route('/new_room', methods=['POST'])
def new_room():
    """
    Handle POST request from contoller
    Create a new channel and add to rooms
    """