Beispiel #1
0
def _get_recent_changes2():
    """New recent changes for around the library.

    This function returns the message to display for each change.
    The message is get by calling `recentchanges/$kind/message.html` template.

    If `$var ignore=True` is set by the message template, the change is ignored.
    """
    if 'env' not in web.ctx:
        delegate.fakeload()

    q = {"bot": False, "limit": 100}
    changes = web.ctx.site.recentchanges(q)

    def is_ignored(c):
        return (
            # c.kind=='update' allow us to ignore update recent changes on people
            c.kind == 'update' or
            # ignore change if author has been deleted (e.g. spammer)
            (c.author and c.author.type.key == '/type/delete'))

    def render(c):
        t = get_template("recentchanges/" + c.kind + "/message"
                         ) or get_template("recentchanges/default/message")
        return t(c)

    messages = [render(c) for c in changes if not is_ignored(c)]
    messages = [
        m for m in messages if str(m.get("ignore", "false")).lower() != "true"
    ]
    return messages
Beispiel #2
0
def _get_recent_changes2():
    """New recent changes for around the library.

    This function returns the message to display for each change.
    The message is get by calling `recentchanges/$kind/message.html` template.

    If `$var ignore=True` is set by the message template, the change is ignored.
    """
    if 'env' not in web.ctx:
        delegate.fakeload()

    q = {"bot": False, "limit": 100}
    changes = web.ctx.site.recentchanges(q)

    def is_ignored(c):
        return (
            # c.kind=='update' allow us to ignore update recent changes on people
            c.kind == 'update' or
            # ignore change if author has been deleted (e.g. spammer)
            (c.author and c.author.type.key == '/type/delete'))

    def render(c):
        t = get_template("recentchanges/" + c.kind + "/message") or get_template("recentchanges/default/message")
        return t(c)

    messages = [render(c) for c in changes if not is_ignored(c)]
    messages = [m for m in messages if str(m.get("ignore", "false")).lower() != "true"]
    return messages
Beispiel #3
0
def _get_recent_changes2():
    """New recent changes for around the library.
    
    This function returns the message to display for each change.
    The message is get by calling `recentchanges/$kind/message.html` template.
    
    If `$var ignore=True` is set by the message template, the change is ignored.
    """
    if 'env' not in web.ctx:
        delegate.fakeload()

    q = {"bot": False, "limit": 100}
    changes = web.ctx.site.recentchanges(q)

    def render(c):
        t = get_template("recentchanges/" + c.kind + "/message"
                         ) or get_template("recentchanges/default/message")
        return t(c)

    # Gio: c.kind!='update' allow us to ignore update recent changes on people
    messages = [render(c) for c in changes if c.kind != 'update']
    messages = [
        m for m in messages if str(m.get("ignore", "false")).lower() != "true"
    ]
    return messages
Beispiel #4
0
def _get_recent_changes2():
    """New recent changes for around the library.
    
    This function returns the message to display for each change.
    The message is get by calling `recentchanges/$kind/message.html` template.
    
    If `$var ignore=True` is set by the message template, the change is ignored.
    """
    if 'env' not in web.ctx:
        delegate.fakeload()
    
    q = {"bot": False, "limit": 100}
    changes = web.ctx.site.recentchanges(q)
    
    def render(c):
        t = get_template("recentchanges/" + c.kind + "/message") or get_template("recentchanges/default/message")
        return t(c)

    messages = [render(c) for c in changes]
    messages = [m for m in messages if str(m.get("ignore", "false")).lower() != "true"]
    return messages