当前位置: 首页>>代码示例>>Python>>正文


Python Wrapped.__init__方法代码示例

本文整理汇总了Python中r2.lib.wrapped.Wrapped.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Wrapped.__init__方法的具体用法?Python Wrapped.__init__怎么用?Python Wrapped.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在r2.lib.wrapped.Wrapped的用法示例。


在下文中一共展示了Wrapped.__init__方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from r2.lib.wrapped import Wrapped [as 别名]
# 或者: from r2.lib.wrapped.Wrapped import __init__ [as 别名]
    def __init__(self, space_compress = True, nav_menus = None, loginbox = True,
                 infotext = '', content = None, title = '', robots = None, 
                 show_sidebar = True, **context):
        Wrapped.__init__(self, **context)
        self.title          = title
        self.robots         = robots
        self.infotext       = infotext
        self.loginbox       = True
        self.show_sidebar   = show_sidebar
        self.space_compress = space_compress

        #put the sort menus at the top
        self.nav_menu = MenuArea(menus = nav_menus) if nav_menus else None

        #add the infobar
        self.infobar = None
        if c.firsttime and c.site.firsttext and not infotext:
            infotext = c.site.firsttext
        if infotext:
            self.infobar = InfoBar(message = infotext)

        self.srtopbar = None
        if not c.cname:
            self.srtopbar = SubredditTopBar()

        if c.user_is_loggedin and self.show_sidebar:
            self._content = PaneStack([ShareLink(), content])
        else:
            self._content = content
        
        self.toolbars = self.build_toolbars()
开发者ID:vin,项目名称:reddit,代码行数:33,代码来源:pages.py

示例2: __init__

# 需要导入模块: from r2.lib.wrapped import Wrapped [as 别名]
# 或者: from r2.lib.wrapped.Wrapped import __init__ [as 别名]
 def __init__(self, sr = None, link = None, listing = '',
              timedeltatext = '', *a, **kw):
     Wrapped.__init__(self, sr = sr, link = link,
                      datefmt = datefmt,
                      timedeltatext = timedeltatext,
                      listing = listing,
                      *a, **kw)
开发者ID:PeerInfinity,项目名称:lesswrong,代码行数:9,代码来源:pages.py

示例3: __init__

# 需要导入模块: from r2.lib.wrapped import Wrapped [as 别名]
# 或者: from r2.lib.wrapped.Wrapped import __init__ [as 别名]
    def __init__(self, space_compress = True, nav_menus = None, loginbox = True,
                 infotext = '', content = None, title = '', robots = None, 
                 show_sidebar = True, body_class = None, **context):
        Wrapped.__init__(self, **context)
        self.title          = title
        self.robots         = robots
        self.infotext       = infotext
        self.loginbox       = True
        self.show_sidebar   = show_sidebar
        self.space_compress = space_compress
        self.body_class     = body_class

        #put the sort menus at the top
        self.nav_menu = MenuArea(menus = nav_menus) if nav_menus else None

        #add the infobar
        self.infobar = None
        if c.firsttime and c.site.firsttext and not infotext:
            infotext = c.site.firsttext
        if not infotext and hasattr(c.site, 'infotext'):
            infotext = c.site.infotext
        if infotext:
            self.infobar = InfoBar(message = infotext)

        self.srtopbar = None
        if not c.cname:
            self.srtopbar = SubredditTopBar()

        self._content = content
        self.toolbars = self.build_toolbars()
开发者ID:Kenneth-Chen,项目名称:lesswrong,代码行数:32,代码来源:pages.py

示例4: __init__

# 需要导入模块: from r2.lib.wrapped import Wrapped [as 别名]
# 或者: from r2.lib.wrapped.Wrapped import __init__ [as 别名]
    def __init__(self, space_compress = True, nav_menus = None, loginbox = True,
                 infotext = '', content = None, title = '', show_sidebar = True,
                 **context):
        Wrapped.__init__(self, **context)
        self.title          = title
        self.infotext       = infotext
        self.loginbox       = True
        self.show_sidebar   = show_sidebar
        self.space_compress = space_compress

        #put the sort menus at the top
        self.nav_menu = MenuArea(menus = nav_menus) if nav_menus else None

        #add the infobar
        self.infobar = None
        if c.firsttime and c.site.firsttext and not infotext:
            infotext = c.site.firsttext
        if infotext:
            self.infobar = InfoBar(message = infotext)

        #c.subredditbox is set by VSRMask
        self.subreddit_sidebox = False
        if c.subreddit_sidebox:
            self.subreddit_sidebox = True
            self.subreddit_checkboxes = c.site == Default

        self._content = content
        self.toolbars = self.build_toolbars()
开发者ID:cmak,项目名称:reddit,代码行数:30,代码来源:pages.py

示例5: __init__

# 需要导入模块: from r2.lib.wrapped import Wrapped [as 别名]
# 或者: from r2.lib.wrapped.Wrapped import __init__ [as 别名]
    def __init__(self, *args, **kwargs):
        from r2.lib.user_stats import top_users
        uids = top_users()
        # Returns a hash keyed in the uid
        users = Account._byID(uids, data=True)
        # Retrieve the Account objects in this way to preseve the sort order
        all_users = (users[u] for u in uids)

        # Filter out banned and spammy accounts
        self.things = filter(lambda user: not c.site.is_banned(user) and user.spammer < 1, all_users)

        Wrapped.__init__(self, *args, **kwargs)
开发者ID:EmileKroeger,项目名称:lesswrong,代码行数:14,代码来源:pages.py


注:本文中的r2.lib.wrapped.Wrapped.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。