예제 #1
0
파일: sources.py 프로젝트: whausen/part
def tag_source(event):
    watches = []
    for topic in event.topics:
        for (tag, count) in topic.tags:
            watches = watchlist.traverse_watchlist(tag)
    for watch in set(watches):
        yield Notification(event, watch.user, watch=watch)
예제 #2
0
def comment_source(event):
    if event.event == T_COMMENT_EDIT:
        for revision in event.comment.revisions:
            yield Notification(event, revision.user, type=N_COMMENT_EDIT)
    if 'comment' in event.data:
        for watch in watchlist.traverse_watchlist(event.comment):
            yield Notification(event, watch.user, watch=watch)
예제 #3
0
def tag_source(event):
    watches = []
    for topic in event.topics:
        for (tag, count) in topic.tags:
            watches = watchlist.traverse_watchlist(tag)
    for watch in set(watches):
        yield Notification(event, watch.user, watch=watch)
예제 #4
0
파일: sources.py 프로젝트: whausen/part
def comment_source(event):
    if event.event == T_COMMENT_EDIT:
        for revision in event.comment.revisions:
            yield Notification(event,
                               revision.user,
                               type=N_COMMENT_EDIT)
    if 'comment' in event.data:
        for watch in watchlist.traverse_watchlist(event.comment):
            yield Notification(event, watch.user, watch=watch)
예제 #5
0
파일: sources.py 프로젝트: whausen/part
def watchlist_source(event):
    watches = watchlist.traverse_watchlist(event.user)
    for topic in event.topics:
        watches += watchlist.traverse_watchlist(topic)
    for watch in watches:
        yield Notification(event, watch.user, watch=watch)
예제 #6
0
def watchlist_source(event):
    watches = watchlist.traverse_watchlist(event.user)
    for topic in event.topics:
        watches += watchlist.traverse_watchlist(topic)
    for watch in watches:
        yield Notification(event, watch.user, watch=watch)