Did I find the right examples for you? yes no

All Samples(0)  |  Call(0)  |  Derive(0)  |  Import(0)
str(object='') -> string

Return a nice string representation of the object.
If the argument is a string, the return value is the same object.

src/c/h/chat-HEAD/src/app.py   chat(Download)
def is_duplicate_name():
    user_name = session.get('user', '')
    for online_user in rc.zrange(config.ONLINE_USER_CHANNEL, 0, -1):
        if online_user == user_name.encode('utf-8'):
            flash(u'该名(%s)已被抢占,换一个吧'%user_name, 'error')
    room_online_user_signal = config.ROOM_ONLINE_USER_SIGNAL.format(room=room_id)
 
    rc.zadd(config.ONLINE_USER_CHANNEL, user_name, time.time())
    rc.zadd(room_online_user_channel, user_name, time.time())
    rc.publish(config.ONLINE_USER_SIGNAL, '')
        room_online_user_channel = config.ROOM_ONLINE_USER_CHANNEL.format(room=room_id)
        rc.zadd(room_online_user_channel, session['user'], time.time())
    rc.zadd(config.ONLINE_USER_CHANNEL, session['user'], time.time())
 
    return jsonify(ts=time.time())
    def check(self, channel, comet, ts, room_id = 0):
        conn_channel_set = config.CONN_CHANNEL_SET.format(channel=channel)
        if 'online_users' in comet:
            rc.sadd(conn_channel_set, 'online_users')
            new_data = rc.zrangebyscore(config.ONLINE_USER_CHANNEL, ts, '+inf')
            if new_data:
                data=rc.zrevrange(config.ONLINE_USER_CHANNEL, 0, -1)

src/c/h/chat-HEAD/src/gc.py   chat(Download)
def clear():
    current_time = time.time()
    affcted_num = rc.zremrangebyscore(config.ONLINE_USER_CHANNEL, '-inf', current_time - 60)
    if affcted_num:
        rc.zadd(config.ONLINE_USER_CHANNEL, config.CHANNEL_PLACEHOLDER, time.time())