예제 #1
0
파일: things.py 프로젝트: nty-/reddit
def default_thing_wrapper(**params):
    def _default_thing_wrapper(thing):
        w = Wrapped(thing)
        style = params.get('style', c.render_style)
        if isinstance(thing, Link):
            if thing.promoted is not None:
                w.render_class = PromotedLink
            elif style == 'htmllite':
                w.score_fmt = Score.safepoints
            w.should_incr_counts = style != 'htmllite'
        return w
    params['parent_wrapper'] = _default_thing_wrapper
    return make_wrapper(**params)
예제 #2
0
파일: things.py 프로젝트: 9peppe/reddit
def default_thing_wrapper(**params):
    def _default_thing_wrapper(thing):
        w = Wrapped(thing)
        style = params.get('style', c.render_style)
        if isinstance(thing, Link):
            if thing.promoted is not None:
                w.render_class = PromotedLink
                w.rowstyle = 'promoted link'
            elif style == 'htmllite':
                w.score_fmt = Score.points
        return w
    params['parent_wrapper'] = _default_thing_wrapper
    return make_wrapper(**params)
예제 #3
0
파일: things.py 프로젝트: ssi379/reddit
def default_thing_wrapper(**params):
    def _default_thing_wrapper(thing):
        w = Wrapped(thing)
        style = params.get('style', c.render_style)
        if isinstance(thing, Link):
            if thing.promoted is not None:
                w.render_class = PromotedLink
            elif style == 'htmllite':
                w.score_fmt = Score.safepoints
            w.should_incr_counts = style != 'htmllite'
        return w
    params['parent_wrapper'] = _default_thing_wrapper
    return make_wrapper(**params)
예제 #4
0
def default_thing_wrapper(**params):
    def _default_thing_wrapper(thing):
        w = Wrapped(thing)
        style = params.get('style', c.render_style)
        if isinstance(thing, Link):
            if thing.promoted is not None:
                w.render_class = PromotedLink
                w.rowstyle = 'promoted link'
            elif style == 'htmllite':
                w.score_fmt = Score.points
        return w
    params['parent_wrapper'] = _default_thing_wrapper
    return make_wrapper(**params)
예제 #5
0
파일: things.py 프로젝트: rajbot/tikical
def default_thing_wrapper(**params):
    def _default_thing_wrapper(thing):
        w = Wrapped(thing)
        style = params.get("style", c.render_style)
        if isinstance(thing, Link):
            if thing.promoted:
                w.render_class = PromotedLink
                w.rowstyle = "promoted link"
            elif style == "htmllite":
                w.score_fmt = Score.points
        return w

    params["parent_wrapper"] = _default_thing_wrapper
    return make_wrapper(**params)